Solved / Wrong timezone in Node Red / Correct time in Hass & in docker container

Dear Community

I am going nuts… I was using Node red before outside of Home Assistant for months. Now I changed to Home Assistant and installed Node Red inside the docker container. Everything works fine so far… I noticed that my timed events in node red were not started correctly, everything seems delayed for 2 hours.

The time inside the container is correct when i enter it like that:
sudo docker exec -it homeassistant bash
bash-4.4# date
Fri Oct 19 20:45:25 CEST 2018

Also when displaying the time as sensor in home assistant it is correct.

But when I create a timer (bigtimer / light-scheduler) the time is 2 hours behind… (looks like set to GMT +0)

Any ideas how to fix this? there seems to be no time zone settings inside node red and docker time is correct?

I am surprised that the console (debug) is showing the correct time when a message appears…?

I tried removing those modules, but somehow I cannot remove them anymore with the new version of node red? (just deactivate?)

o.O

Inside the Home Assistant container?

In hass.io by using the repository. i saw that in the log in this module the time was wrong as well, but in the log of another hass module (dashio) the time was correct.

finally a update for hass appeared and after installing and restarting node red the time was correct now… weird, but i’m pleased that the problem is solved now…

I have exactly the same issue, with exact 2 hours difference in Node Red inside Hassio, while in debug log the time is correct.
I have all the latest versions of Hassio and Node Red.
How can I resolve this issue?

I’m having same issue!

I have Hassio in Docker and using Portainer.

From Portainer I see that TZ is set as UTC but I don’t know how to change it.

Any suggestion?

Thanks

Same here. It way one hour off in winter, now that summer time started there is a difference of 2 hours.

I solved this way.
From Portainer I entered into the container console as root and I did this, in my case,

TZ=Europe/Rome

Then rebooted the container and now all is OK

1 Like

Doesn’t work for me. I installed Node Red as a Hassio Add-on, It’s not a container but an image, so I don’t get the option to go into console in portainer.

Any ideas?

Strange, because I have several addon, like Configurator, seen as additional container, and I can enter in the console

31

For me the only one that gets added as a container is dasshio. All the others (Node-Red, Configurator, ADB Config Bridge and so on) are showed as “images” only.

I guess I’ll never understand this container thing :thinking:

An image is what gets pulled from repos or local builds to run a container.

You did something really wrong

Sorry, I was messing things up (Like I said, I just don’t understand it)
Dasshio = container
all others = images
I installed all of them via the Hassio UI.

I can’t find a setting to change the timezone for images

EVERY docker container running is a container. An image is what is downloaded to run. If it’s running, it’s a container.

fyi, i had this issue on my raspberry pi dockers.

you have to add:

-v /etc/localtime:/etc/localtime:ro

Which you can’t do with HassIO

Yeah, it was my bad. I had to follow the two steps mentioned here (only did step 1) to see all containers. By default for the hassio add-ons only the images are displayed.

For changing the timezone: using TZ=Europe/Rome in console didn’t work because it was passed as environment variable in the container settings.
So for anyone who runs into the same problem:

  1. open the portainer addon
  2. click on the node red container
  3. click Duplicate/Edit
  4. Go to the Env Tab
  5. there is a variable called TZ, it was set to UTC for me. Change it to your timezon (eg. Europe/Rome)
  6. Hit deploy and accept the warning (you will override your old settings)
    -> wait for the addon to start. should be working now!
2 Likes

Hello,

I’ve been with the same problem and capstan1 procedure solves the problem, at least temporarily.
What I’m noticing is that when I reboot or restart Hassio the TZ variable is reseted to UTC on node rede container.

I’ve tried to set it permanently on portainer by generating a new image and to create a new node red container with it but with no results, what ever I do the container is recreated with the original settings.

Any recommendations?

Regards

The work around did not work for me, my container is set to EET same as my Hassio setup, however node-red is still using UTC, except for in the debug window.