Timestamp to UTC time

Try wrapping the timestamp in a new Date. While that produces a JavaScript Date object, when you convert to CSV, that should automatically translate to ISO8601 date format which is always in UTC.

"Tjd": (new Date(msg.payload.utcTimeStamp)),

If that doesn't work, Date objects have a toISO function. You can look it up on MDN.

1 Like