I'm running node-red in a docker container on a Synology NAS.
Unfortunately, I'm not able to set the right, local Timezone (Europe/Berlin).
I mounted the following Volumes
and I did also insert the Timezone in the settings.js
process.env.TZ = "Europe/Berlin";
but in Node-red I still only get the UTC-Time (Timestamp).
I would be glad, to find some help ore advices here.
Thanks in advance and best regards - Daniel
Doesn‘t anyone know the problem or can anyone give me some advice?
Thanks in advance - Daniel
What are you doing that tells you it is UTC?
What does Date.getTimezoneOffset() give?
Hi, the TimezoneOffset ist -60, which seems to be correct for Germany.
But if I want to use a timestamp like
var currentDate = new Date();
I always get the UTC-Time. And if I then want to continue using it, I always have a difference of one hour to the current local time.
I'm still a newbie to working with nodered and programming stuff like this, but I thought if I asked for the actual time, I would get the current local time. - Thanks for help!
What do you mean by that?
What is it that you want to do with it?
Remember there is only one time, 12:00 UTC is the same time as 13:00 UTC+1, they are just different ways of displaying the same time.
Hi, thanks for the quick response. For various events I have set up context variables that contain an entry in conjunction with a timestamp: E.g. last change in temperature, in conjunction with a timestamp.
If I print the variable with debug as mentioned before, I can see that the temperature changed at 13:56 (UTC+0). But in local time (Germany) the temperature changed at 12:56 (UTC+1).
My assumption was that I would get the local time with "new Date()" and that consequently nodered's time setting should have been incorrect. But now I assume that it is correct that the timestamp always includes UTC+0?
Assuming that the timestamp was created using
new Date() then the date shown is just the way the debug panel has chosen to display it.
I think you meant 12:56 UTC - 1.
As I said earlier, 13:56 UTC and
14:56 12:56 UTC-1 are the same time.
You get the time.
In what way is this causing you a problem?
I think I'm fine with this result. I was able to find out that Node-Red is set with the correct timezone, and I understood how the timestamp thing works. Thanks for your help! Best regards - Daniel
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.