I am trying to construct a comma delimited string (msg.payload) and writing it into a CSV file when an event happens. What I am getting is not my local time, but Zulu time and I'm not sure why.
Here's what I'm doing:
var d = new Date();
var t = d.getTime("hh:mm:ss");
payload={"date":d,"payload":msg.payload,"Source":"BlueIris Geofence","Action":"Light Status Change"};
msg.payload=payload;
return msg;
Here is what I'm getting:
date,payload,Source,Action
"""2022-06-02T23:55:00.142Z""",HOME,BlueIris Geofence,Light Status Change
How do I get the date / time format to be mm/dd/yyyy hh:mm:ss (in EST)?
Here's what I'm doing:
var d = new Date();
var t = d.getTime("hh:mm:ss");
payload={"date":d,"payload":msg.payload,"Source":"BlueIris Geofence","Action":"Light Status Change"};
msg.payload=payload;
return msg;
Here is what I'm getting:
date,payload,Source,Action
"""2022-06-02T23:55:00.142Z""",HOME,BlueIris Geofence,Light Status Change
How do I get the date / time format to be mm/dd/yyyy hh:mm:ss (in EST)?
Comment