docker-MagicMirror: Time of dates are wrong

Hi, i have a quiet strange problem. All dates of the calendar are one hr in the future now in winter time. In the summer time it was 2 hrs.

I thought the time setting of the docker container is wrong. So i’ve started it now with -v /etc/localtime:/etc/localtime:ro to have the same time as the host.

checking with docker exec -it [ID] date confirms it.

But still the same problem. With a “normal” MM installation i don’t have any problem like this.

How can this happen with the docker image?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

Afaik, if you want to set a timezone for a container you can pass the correct one on using the environment: TZ: ‘Europe/Brussels’ SET_CONTAINER_TIMEZONE: ‘true’ CONTAINER_TIMEZONE: ‘Europe/Brussels’

No need to rebuild.

I needed to set the clock with -e on both client and server for everything to work.

Piece of cake: Just pass them via the docker run command, i.e. add

-e TZ=Europe/Berlin -e SET_CONTAINER_TIMEZONE=true -e CONTAINER_TIMEZONE=Europe/Berlin

I haven’t actually checked yet whether actually all three of them are required.

If anyone using Compose stubles accross this in the future:

    environment:
      - TZ=Europe/Berlin
      - SET_CONTAINER_TIMEZONE=true
      - CONTAINER_TIMEZONE=Europe/Berlin