Giving wrong unix time back

#1

hello,
I got a Problem with the following flow

[{“id”:“c83c9bc7.3128b”,“type”:“inject”,“z”:“f2b41c94.70381”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“date”,“repeat”:"",“crontab”:"",“once”:false,“x”:180,“y”:1480,“wires”:[[“4921115c.bdf2a”]]},{“id”:“4921115c.bdf2a”,“type”:“function”,“z”:“f2b41c94.70381”,“name”:"",“func”:“var now = new Date();\nvar Time = now.getTime();\nmsg.payload = Time;\nreturn msg; “,“outputs”:1,“noerr”:0,“x”:380,“y”:1480,“wires”:[[“f58a73d0.89bc18”]]},{“id”:“f58a73d0.89bc18”,“type”:“debug”,“z”:“f2b41c94.70381”,“name”:””,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“x”:550,“y”:1480,“wires”:[]}]

the Problem is that it doesn t give the correct unix timestamp back… it is 3 numbers longer than the unix timestamp…

0 Likes

#2

Ahh, but is it giving the correct JavaScript time stamp back?

0 Likes

#3

ah yes okay, I m sorry, I had no idea that Java script have it s own timestamp.

0 Likes