Page 1 of 1
DST condition
Posted: 02 Apr 2019 08:14
by Wibbly
Anyone know how to test if the phone has set itself into Daylight Savings Time?
Re: DST condition
Posted: 02 Apr 2019 13:45
by anuraag
Code: Select all
tz=callJavaStaticMethod("java.util.TimeZone", "getDefault()");
//timezone
DST=callJavaMethod(tz, "java.util.TimeZone", "observesDaylightTime()"); //will give true for if DST is on
Re: DST condition
Posted: 05 Apr 2019 13:14
by Wibbly
Thanks, will give that a try -)
Re: DST condition
Posted: 30 May 2019 12:33
by Wibbly
Gives an error:
No method with name observes DaylightTime found in class libcore.util.ZoneInfo (Expression: callJavaMethod(tz, "java.util.TimeZone", "observesDaylightTime()")[line 2], Cause: observesDaylightTime [])
Re: DST condition
Posted: 30 May 2019 14:08
by anuraag
Try
Code: Select all
tz=callJavaStaticMethod("java.util.TimeZone", "getDefault()");
//timezone
dst=callJavaMethod(tz, "java.util.TimeZone", "inDaylightTime(java.util.Date)", callJavaConstructor("java.util.Date", "Date()"))
Re: DST condition
Posted: 03 Jun 2019 11:59
by Wibbly
Thanks - will see what happens when we move from DST later this month
Re: DST condition
Posted: 20 Jun 2019 19:32
by webtrekker
Thanks for that anuraag. It seems to work fine for me.