Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mrburnette
#32109 GPS lat/lon coordinates translation to DST is problematic as not everyplace utilize DST and not all uses of DST are 1-hour integer! Some locals use DST in increments as small as 15 minutes!
Add to the above the U.S.A. Congress concept of screwing with the dates of implementation/duration and you can understand why so many commercial companies simply make the DST a configurable end-user option... even on the low-cost radio-controlled clocks in department stores.

Calculating Day-Of-Week and other such things are however somewhat simple. I have some routines in my GPS clock code:
http://www.hackster.io/rayburne


Ray
User avatar
By forlotto
#32140 Oh I agree totally TZ is a wash really

but what I meant I suppose is the box or button could simply have code that would check for the DST TZ and apply it....

If you want you can view the source of my HTML page I worked on that has every timezone feel free to use it if not for commercial use... You will have to integrate PHP and Cron to handle sending controls to your site remotely.

Anyways check it out www.icepik.tk ... This is everything as far as data goes you will have to write the code to handle the data
User avatar
By bbx10node
#32178 I just realized Weather Underground returns local time in addition to weather information. Perhaps checking weather once per day shortly after 2AM is enough to get local time offset with DST correction. I am not sure if 2AM is used outside the US so perhaps checking once per hour is safer. The following is an example of the JSON returned for a check of current weather conditions. Note local_tz_short, local_tz_long, and local_tz_offset.

Code: Select all    "local_time_rfc822": "Wed, 27 Jun 2012 17:27:14 -0700",
    "local_epoch": "1340843234",
    "local_tz_short": "PDT",
    "local_tz_long": "America/Los_Angeles",
    "local_tz_offset": "-0700",


See this project for an example of parsing wunderground JSON. Most of the hard work is done by the ArduinoJson library.

http://x10linux.blogspot.com/2015/09/di ... using.html
User avatar
By rajdarge
#32210 Thanks so much for that weather underground stuff.
I couldn't find the tz_offset in the documentation of the API but that is the data that I really want.
I don't care if dst is in force or not I just want to display to the end user the correct, current, local time.
I will record on SD temperatures with a UTC timestamp, and offset as obtaining historical TZ and DST time is a nightmare I'd rather not have.
The manual option is not appealing as the setup needs to record temps without intervention for several days, but also serve the dual function of displaying the correct current time.