Hello,
I am new to Node-Red in Home Assistant.
I am in France and I would like to have the dates in the format of the country, just like the hours (without AM / PM ...).
I added this line in the settings.js file:
process.env.TZ = "Europe / Paris"
But it does not work.
What should I do ?
Thank you
Hello Colin!
Thank you for your welcome
I would like to see the timestamps in local time in the status of the nodes but especially in the result of the following function:
thank you very much
Node function :
var d = new Date();
msg.payload = d.toLocaleString();
return msg;
Log :
Here I would like to see: 02/17/2021 20:35:44
Unless the developer of that node provided a method of updating the status you cannot modify it. You can format a string and display whatever you want beneath a function node or debug node only.
Ok, alright.
I found someone on the forum talking about the function-npm node. It allows me to use moment () and get at least the hour in HH: MM: SS.
is that not a problem?
For the moment, I prefer to use Javascript, I find it more understandable than JSONata which I sometimes have trouble understanding ...
In any case, thank you!
You might also find node-red-contrib-simple-time useful. It does many of the simple things that node-red-contrib-moment does but does not have the overheads of the moment module.