I try to play with Date() inside a function block and found something curious...non blocking, but I would be happy to understand.
I need a timestamp in millisecond style (a non formatted integer) so I can easily compare or do some processing.
at first I tried this:
var test = new Date(); msg.payload = test; return msg;
And output this on a debug box.
debug windows shows:
The date is written in read a looks like a formatted text output, so I thought I may not be able to use this for comparison or operation, but just in case, I tried this:
var test = new Date(); msg.payload = test - 3600000; return msg;
This time the debug windows shows a numeric payload, written in blue:
I can click on the blue value to see different format like:
So it seems fine: I guess I can do what I need to do with my "test = new Date();".
But I wonder why it shows like a formatted string if I do not modify my value...?