bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
186 stars 54 forks source link

Timezone correct, modules won't follow it #50

Open squirtbrnr opened 3 years ago

squirtbrnr commented 3 years ago

I am running this docker on a Synology NAS. I got it up and running with no issue. I set the timezone variable and also linked /etc/localtime. When I check the date/time of the container it is correct and matches the host system. The clock module is also correct with the correct time (with or without the time zone config line for the module). However, other modules such as a sports scoreboard, an "on this day" calendar, and even the holidays calendar seem to be running on UTC, not my actual timezone (UTC -6). In otherwords, right now my clock, the container, and system shows it is 20:45 on 11/24, but the other modules have all switched to showing things as if it was 11/25. No errors in the docker logs or system logs. The docker logs also appear to be in UTC time as the generated logs are showing 11/25 already. Here is my docker cli command. What's causing modules to ignore the timezone?

docker run -d \
  --name=magicmirror \
  --restart no \
  -v /volume1/docker/magicmirror/config:/opt/magic_mirror/config \
  -v /volume1/docker/magicmirror/modules:/opt/magic_mirror/modules \
  -v /etc/localtime:/etc/localtime:ro \
  -e TZ=America/Chicago \
  -p 8081:8080 \
  bastilimbach/docker-magicmirror:v2.13.0
ckboyle commented 3 years ago

I'm seeing something similar in my calendar module - only it differs by calendar and sometimes even by event within a calendar.

I switched to the "develop" branch as someone on the MagicMirror repo mentioned a similar issue was fixed in the develop branch. That develop branch as a standalone install works correctly, but when I use the container I have the mishmash of timezones in my calendars.

Legion2 commented 3 years ago

try to start the container and open a shell (sh, bash) and then use the date command to check if the date is set correctly.

docker run -it --rm
  -v /etc/localtime:/etc/localtime:ro \
  -e TZ=America/Chicago \
  bastilimbach/docker-magicmirror:v2.14.0 \
  bash
ckboyle commented 3 years ago

Yes - running date from a bash prompt inside the container returns the correct date.

squirtbrnr commented 3 years ago

the date command returns the correct time date.

timezone environment variable is set and the localtime folder is mapped to the container.

I just noticed v2.14.0 was released 3 days ago. I’m running v2.13.0, so I’ll have to test this again later.

Legion2 commented 3 years ago

when the date and time is correctly set in the container, it must be a problem of MagicMirror not using it correctly.