2

I would like to show two or more time zones on a watch face, but different time zones undergo DST transitions at different times of the year. Ideally, the watch would either have its own IANA / Olson time zone database either cached or synced with a phone, but according to this post, the best option seems to be "make an HTTP query".

Has anything changed in terms of time zone handling? I would like to handle time zone data entirely on-device if possible.

Paul
  • 10,381
  • 13
  • 48
  • 86
  • Are you asking specifically about a [C Watch Face](https://developer.pebble.com/tutorials/watchface-tutorial/part1/) with the standard Pebble SDK? Or would you consider a [JS Watch App](https://developer.pebble.com/tutorials/pebble-js-tutorial/part1/)? – Matt Johnson-Pint Jul 02 '16 at 22:13
  • @MattJohnson I don't "know" JS, per se, but learning how to make a watchface in JS couldn't be much harder than writing a tzfile parser plus time zone handling logic, so I guess I'm indifferent between the two ;) – Paul Jul 02 '16 at 22:20
  • @MattJohnson Scratch that: "Your Pebble.js application ​is run on the phone, it’s not actually running the JavaScript ​on the smartwatch itself." That's a no-go. Has to be on-device because I don't want basic functionality to rely on the use of a phone or server. – Paul Jul 02 '16 at 22:22
  • It's unlikely that a full IANA TZDB implementation would ever be implemented in C directly on the watch. It's just too much data. However, you could export a *subset* of the few time zones you were interested in, or the POSIX `TZ` string for the "current" rule of a particular time zone. You'd have to update it regularly since rules can change over time. So complete detachment from a phone seems like a no-go. I don't have a Pebble, so can't say for certain. There are some mentions of this [here](https://forums.pebble.com/t/what-is-your-most-desired-feature-for-next-firmware-sdk-update/8949/2). – Matt Johnson-Pint Jul 02 '16 at 22:27
  • @MattJohnson There actually is almost certainly a full tzdata database available (though it might be a subset that drops all historical zone info), because the time zone selector is very obviously based on that. The issue is that the SDK apparently doesn't expose access to the data. – Paul Jul 02 '16 at 22:38
  • Interestingly, since you can't set a TZ variable, this does seem to make it difficult to set your watch to GMT. – Paul Jul 02 '16 at 22:39

0 Answers0