Date confusion #605
Replies: 1 comment
-
Posted at 2016-08-04 by @allObjects nope.... (no problem in your code) - may be... (in interpretation of doc)...
On power on - py Pico shows 949363215.70712661743 seconds for
... after uploading, it shows more 'now': 1470274624.28208160400
Initially, there was no synchronization between time of your Browser/Web IDE and time of Espruino. Today, when uploading code (even empty editor pane), time is set to GMT+0000 (UTC) from the Browser/Web IDE has. Date() 'class'/object has always GMT+0000 / UTC. If Espruino connected to, for example, Web / http or a GPS, you may pull time from there. You can set the time by taking the [ms] since "Thu, 01 Jan 1970 00:00:00 GMT" - in Browser Inspector Console with This conversation 'fools' around with date and time formatting. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-08-03 by MichaelPralow
i am working with dates and got some confusing behaviour
i expected to be able to create a new
Date
with the valuefrom getTime()
getTime() returns a floating point number, but with rounding
Math.round(getTime());
the result does not changeIs there some error in my code or my expectations, maybe some misinterpretation of the docs on my side?
Beta Was this translation helpful? Give feedback.
All reactions