Dual Time zone question

Hello all,
I am pretty new to programming in this environment. I'm building an homage to on of my favorite dual-time mechanical watch faces. I have been fairly lucky so far to get my watch face running in the simulator. I now have the second time zone dial working but I cannot figure out how to calculate the timezone offset from UTC (so I can set the small dial to my home time). Ideally, I would want the small dial to always show my home timezone and the large dial to show current time via GPS. I am not sure this is possible.

I have included a image of my work in progress and I'd love any suggestions for layout and/or enhancements. Please note, the hands are using drawLine but I intend to produce nicer looking bitmaps soon. I am just working on the layout



Thanks,
Roy
  • Roy,

    I am working on a digital version of the same.

    The second timezone is challenging - programming for a specific time zone is pretty straight forward. You can calculate your offset from UTC and have logic to address Daylight Savings Time (DST) if the area that you are in observes this. The challenge comes when you want to make this a universal face. There are numerous timezones and they don't all observe the same transitions in and out of DST. In addition there are non-whole hour deviations from UTC. In addition to the numerous timezones there is an issue for how to select the specific timezone. In the next version of Connect, there will be a system to allow user input into a watchface. Then you can have the user set their own timezone.

    I have made a request for two functions that would help in this effort.

    1 - a function or constant that would provide a last known good position to the watchface. This would allow the watchface to be position aware. Not accurate, but aware.

    2 - a function that provided with a position would provide the local time at that location. I think that internally the watch has this capability and is used when you GPS sync and the time updates.

    Using these, the first time the program starts it could pull the last known good position and save this in the object store for the watchface. Then when out of your preset location/timezone, you can calculate the time at your home location using the stored position and the function given in 2.
  • At least on the va, the two ways it sets it's time are manual, or from the mobile device. It doesn't use GPS to set time.

    Using GPS would be complex, as time zone lines aren't straight or consistent, and often follow state or country borders, or landmarks (like a river), Then you have MT in the US - where AZ as a state doesn't do DST, but one of the areas to tribal land does. And has someone mentioned, you also have the "half" TZs.

    Local time (as set from a mobile) and UTC isn't bad, but local vs another TZ pretty much means keeping a table of that other TZ (dates of DST, or even if it's used at all).

    And like I said, MT in the US adds the "Arizona" factor. (you'll notice on windows, how there is a TZ called "Arizona"). I don't think Hawaii does DST either.

    Others have done multiple TZ's - I'm just saying it's a bit of work!
  • stickittome,
    Thanks for the very thorough reply. I suspect I will just hard code to my home time for now (PST/PDT) and wait a bit to see if the function requests bear fruit. What is your experience on fulfilling requests like this? These 2 seem very reasonable. BTW, when is the next version of connect due to drop?


    Thanks again,
    Roy
  • Roy,

    My understanding is that the next drop of Connect that would support user entering data for a watch face will come in September. Right now I have my own personal version of SOF - UTC with mountain time programmed instead of UTC. I am not looking forward to trying to program all the various timezones and DST start/end functions. Keeping fingers crossed that my suggestions might make it in.

    Paul