mbround18 / valheim-docker

Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which is designed with resiliency in mind by providing automatic updates, world backup support, and a user friendly cli interface.
https://hub.docker.com/r/mbround18/valheim
BSD 3-Clause "New" or "Revised" License
767 stars 82 forks source link

Timezone inside container off by one hour #54

Closed broizter closed 3 years ago

broizter commented 3 years ago

Outside container:

$ timedatectl
        Local time: Fri 2021-02-12 11:18:01 CET
        Universal time: Fri 2021-02-12 10:18:01 UTC
        RTC time: n/a
        Time zone: Europe/Stockholm (CET, +0100)
        System clock synchronized: yes
        NTP service: inactive
        RTC in local TZ: no

But this is what the container returns:

$ docker exec -it valheim date
Fri Feb 12 10:17:33  2021

$ docker exec -it valheim env | grep TZ
TZ="Europe/Stockholm"

So the container gets the correct timezone variable, but it's off by one hour.

mbround18 commented 3 years ago

This is a linux specific issue, timezone data does not typically adjust for daylight savings. A work around I can recommend is pick a time that your group is not online. For example like 1 am.

Use variable AUTO_UPDATE_SCHEDULE

Example:

AUTO_UPDATE_SCHEDULE="0 1 *" Useful site for figuring out cron timings

https://crontab.guru/#0_1___*

broizter commented 3 years ago

That helps for updating, but it's looking through the logs that was annoying me the most honestly. I don't have this problem with a single other host/virtual machine/docker container that allows timezone to be set so I'm not sure what you mean it's a Linux specific issue?

Example:

$ docker exec -it influxdb date
Fri Feb 12 21:50:52 CET 2021
$ docker exec -it valheim date
Fri Feb 12 20:50:51  2021

@mbround18