I am using the code below in a format node to pull data from openweathermap to create a small .csv data base. I am having a hard time getting and formatting date time info into date,time or datetime, I am only able to extract time,? Is there a resource for syntax for these simple extract and string functions other than StackOverFlow?
Thanks,
Loon
tvar first=context.get('first') || 0;
if(first == "0")
{
context.set('first',1);
All = " Time Temperature Humidity Pressure";
}
var LocalTime = new Date();
var Tim = LocalTime.toLocaleTimeString();
Temp = msg.payload.tempc;
Hum = msg.payload.humidity;
Pres = msg.payload.pressure;
if(first != "0")
All = Tim + "," + parseFloat((Temp*1.8)+32).toFixed(2) + "," + Hum + ","+parseFloat((Pres)/33.86).toFixed(2);
msg.payload = All
return msg;