General area when it fits no where else

Moderator: Mmiscool

User avatar
By lew247
#55582 Could someone please explain where the command TIME() actually gets the time from?
I live in the UK and when I do it, it comes back with the correct local time which at the moment is 1 hour ahead of GMT/UMT
What I need to know is, will it always have the correct local time no matter where in the world you are?
Will it automatically update depending if BST/DST/EST or any of the other time adjustments happen?
If it possible to know where exactly the ESP gets the time information from? I presume it's one of the NIST servers or something similar, is it possible to change the server?
User avatar
By Mmiscool
#55589 Yes. by default it uses nist time servers.

You can specify your own server and offset from gmt. Also daylight savings if applicable.

The setup code for the time function is linked to below.
https://docs.google.com/document/d/1EiY ... z2o5d3z1tp
User avatar
By Gennadiy
#58125 Please tell me more about the operator
Time.setup()
How does he work

My module is connected to the Internet

command
Print time()
shows
Thu Jan 01 00:00:00 1970

I use
time.setup("+3", "0", "time-a.nist.gov")
or
time.setup("+3", "0", "129.6.15.28")
Print time()
shows
Thu Jan 01 00:00:00 1970

How to obtain reliable data on the time?

Give an example code please.

Thank you.
User avatar
By Mmiscool
#58231 To use the time.setup() function you have to have a delay afterwards so that it can sync.