Timestamp, epoc time, and console.log #5734
Unanswered
espruino-discuss2
asked this question in
Bangle.js
Replies: 1 comment
-
Posted at 2023-02-23 by dapgo I am seeing that it is as easy as adding to .toString() to get the format xxx Feb xx 2023 h:mm:ss GMT+0100 console.log("pressDate "+pressDate.toString()); for some reason when using the Date.now() the to String was implicit Posted at 2023-02-23 by @gfwilliams I think it's the difference between these two?
Posted at 2023-02-23 by dapgo Yes, you are right Not good to read/write code at afternoon, if i read 100 times, I wouldn't see this different character/operator... Also i was sure that all console.log were based in copy/paste and using the same operator.... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-02-22 by dapgo
After some testing I've realize that epoch time from Date.now() and returned from setWatch() are different, and yes it is documented that 2nd one is using float.
I wanted to see in human readable format, and i can do for the result of Date.now(), ie:
But I have problems with console.log when using the float from setWatch()
On the other hand, from the IDE console, when i assign the previous float*1000 to a var I can see a human readable value, i.e
I am sure that there is an easy explanation and my issue is causes from the lack of theoretical basics.
Beta Was this translation helpful? Give feedback.
All reactions