DST condition
Moderator: Martin
DST condition
Anyone know how to test if the phone has set itself into Daylight Savings Time?
Re: DST condition
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
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 [])
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
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
Thanks - will see what happens when we move from DST later this month
- webtrekker
- Posts: 14
- Joined: 30 May 2019 23:58
Re: DST condition
Thanks for that anuraag. It seems to work fine for me.