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:
console.log("now "+Date.now());
//1677093816456.81469726562
var keyDate = new Date(Date.now());
console.log("converted Date.now",keyDate);
//Wed Feb 22 2023 20:23:36 GMT+0100 OK
But I have problems with console.log when using the float from setWatch()
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.