-->
Page 1 of 5

NTP time with DST and TZ help!!!!

PostPosted: Sat Oct 17, 2015 8:41 pm
by rajdarge
Is there a way of Getting the current LOCAL time via GPS coordinates?|
There is a googlemaps discussion regarding this, but I really don't have the Web Coding skills to work out what to do.
An app on my android called Polyclock has a GPS/ TZ database which works on my Phone and Tablet to give me immediate access to local time by GPS alone.
I am assuming it would be too large a DB for humble microcontroller.

There must be a webservice to obtain local time somewhere?

I have an NTP derived working display on my ESP8266 and its able to return UTC quite nicely, then I add in TZ manually and then DST means I have to change the code twice a year. If I use the library for DST, you have to manually put in the dates of change, which means if DST starts/stops at a different date, then the code has to be re-flashed. Not really a universal solution.
Is there working code already out there? I've been looking for months now.

Re: NTP time with DST and TZ help!!!!

PostPosted: Sun Oct 18, 2015 4:02 pm
by bbx10node

Re: NTP time with DST and TZ help!!!!

PostPosted: Sun Oct 18, 2015 5:58 pm
by forlotto
Couldn't you just add a checkbox for DST? Which would simply subtract another hour from the time and then check if the box is checked?

This would help you from having to change code just check a box.

If not you will have to scrape the time from the timezone selected upon boot and begin using the tmr function to update the time... IDK

Just thinking out loud maybe it will help maybe not.

Time can be difficult you have to convert to minutes then do math and convert back to time etc... I don't fully know how to go about it via code per say but these are the things that have to be done.

Re: NTP time with DST and TZ help!!!!

PostPosted: Fri Oct 23, 2015 4:22 am
by rajdarge
Thanks for those links By bbx10node, the first one I did know about, the second one is new.
Thanks also for the checkbox option (which could be a button press).
I wanted a truly automatic option for a data logger and so I can have a custom clock that doesn't need phone or computer to display. Of course I will need a WiFi connection.

I wasn't sure if esp8266 can do https, nor do I have the knowledge to be able to code passing of html script.
I think the google link will be Te better as I doesn't require registration does it?