How to determine DST on the watch?

I found DST always returns 0 on the actual watch when using Toybox.System.getClockTime().dst. I wonder what would be a good workaround?

I do see System.getClockTime().timeZoneOffset correctly gives the correct offset from UTC (reflecting DST). Maybe that could be used as a workaround if I knew the current time without DST. Any idea?

Context is that I want to show 'DST' icon if DST is active for current location.

Top Replies

All Replies

  • Actually, it is updating, I have the logs via system.println to prove it. For example, yesterday it recorded when I arrived at my inlaws house for lunch, and three hours later it recorded that I got home. I call for position info every 20 minutes.. It's just always 1 "last known good". I'm guessing it's getting location from the phone via bluetooth, and not GPS, but on that I'm just speculating. All I know for sure is that we'll never know for sure.

    		var gAngle = Math.cos(myLat) * Math.cos(oldLat) * Math.cos(myLong - oldLong) + Math.sin(myLat) * Math.sin(oldLat);
    		var distMoved = (gAngle.abs() < 1) ? (6371.0d * Math.acos(gAngle)).toFloat(): 0.0 as Float; // earth radius km
    		if (distMoved > 10.0) {
    			System.println(dateStr + " locAcc " + locAcc + ", locPos " + locPos + ", dist " + distMoved);
    		}

  • Sounds like it's maybe from Toybox.Weather.  The phone's location service.  Probably won't work on older devices.

  • I'm guessing it's getting location from the phone via bluetooth, and not GPS, but on that I'm just speculating. All I know for sure is that we'll never know for sure.

    Not to state the obvious, but you can try to recreate similar circumstances, but with bluetooth disabled. If the position is not updated, then that would suggest it was previously updated from your phone.

  • I have more information on this now that I'm back from a cruise. At sea the phone doesn't have wifi on and is in airplane mode because they are expensive and metered so they are on only when needed or in port. The only thing enabled on the phone is Bluetooth.

    Test 1: When we crossed into a new time zone the watch had the old time until I ran a GPS app on the phone while on the balcony. Once it fixed, the watch updated with the new time in a just a few seconds. The time did not change on the phone. It didn't update with the correct time until we reached the next port and I could connect to a local cell tower.

    Test 2: Crossing into yet another time zone, this time I used the Hike app to start the GPS fix process on the watch. Once it fixed, again the time updated as expected. As a side note, is there a way to just have the GPS do a one-shot fix in the background without having to start an activity?

  • Not background, but manually you can do this: Settings / Time / Sync with GPS. Just used this for a trip crossing timezones and worked well. The 'Auto' just uses GPS and that's I assume only updated when you use an activity.

    I created a watchface that shows current timezone visually (similar to Casio map) and found it's working reliably now using the info from this thread (tested 3 timezones so far).

    https://garmin.watchfacebuilder.com/watchface/64fc8daac2876/