setTime #5257
Replies: 1 comment
-
Posted at 2016-01-25 by @gfwilliams Moving this to the ESP8266 section... I'm not sure Posted at 2016-01-26 by cwilt I got it to work.
Posted at 2016-01-26 by @allObjects Neat! Posted at 2016-01-27 by @gfwilliams I have some things here that do this, and it works fine for me:
It just pulls the date field right off the HTTP headers, so all you need is a standard HTTP server. Posted at 2016-01-27 by cwilt No local server in my home. Plan to create a http server that has current time with weather info etc. Will see if it runs out of memory before I get it done. Posted at 2016-01-28 by @gfwilliams Just to add that literally any HTTP server will do - including google.com, or in some cases even your broadband router (if it keeps an accurate date). Posted at 2016-01-28 by AkosLukacs @gfwilliams capitalize your last line, it's simply brilliant :) Altho not exactly correct if you are other timezone than the UK, and want to get your local time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-01-25 by cwilt
I am trying to set the time on my Espruino loaded esp8266. I am using an http get request and getting a string like "2016-01-25T12:33:20+00:00" back from the server. When I try to set the time it never sets it correctly.
Using...
setTime(Date.parse("2016-01-25T12:33:20+00:00"));
If I do Date.parse("2016-01-25T12:33:20+00:00");, the ms returned is wrong. If this is not a proper format date string then what is?
Beta Was this translation helpful? Give feedback.
All reactions