Hi,
I have a msg with date and time separated in two elements, and I want to merge tha values from these two to be able to output a timestamp. Anybody know how I can make that happen in a function node?
msg.payload.originalDate: "2021-10-30"
msg.payload.originalTime: "21:30:00.000"
I want to use these values to output this timestamp 1635622200000
Here was my first try and of course it didn't work, but hopefully it shows what I want to accomplish.
var date = msg.payload.originalDate
var time = msg.payload.originalTime
var alarm = new Date(date, "T", time)
var msg2 = {payload: alarm.getTime()};
With this configuration instead of the one above
var alarm = new Date(date)
I get a timestamp output, but I just can't figure out how to get the time in there aswell.