Application containers are in UTC timezone regardless of the system settings

Description

I noticed this first with Immich. It was showing pictures from the same day as if they were from yesterday. When I checked the logs, the application was operating a few hours into the future. I double checked system Timezone and app Timezone (picture 1) and everything was correct. I started container shell and checked both time and timezone. Time seems to be correct, but timezone isn’t. I checked the other app I have (plex) and it had the same problem.

Problem/Justification

All containers are in UTC timezone even if my system settings is America/Louisville. Some applications have problems functioning properly because of this

Impact

None

Attachments

8

Activity

Show:

Bug Clerk March 27, 2025 at 1:02 PM

This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.

Bug Clerk March 27, 2025 at 1:01 PM

/etc/timezone hasn’t been used by linux for many 10’s of years at this point. Applications should either have their own timezone setting or read from /etc/localtime to figure out what the host’s timezone settings are. Anything using glibc has been using /etc/localtime since the 1990’s IIRC. Either way, this is not a bug in our software. Circling back around to the reported issue, this seems to be an issue with apps and how they’re configured. Either way, this isn’t a bug on our side after looking through this. Going to close the ticket, thanks!

Nikola Novakovic March 22, 2025 at 1:10 AM

Thank you Stavos. I guess I will need to then experiment with Immich config and see how to make picture DB be in my timezone.

I did notice in my last video that system /etc/timezone is different than what is set in UX under system localization settings. This is unrelated to docker, just an observation.

Stavros March 21, 2025 at 2:24 PM
Edited

So, the TZ variable will not affect /etc/timezone (well some apps update that too during their startup procedure, but that’s up to the container to do that).

Beyond that, its up to each application to use the TZ variable which is standard in linux.
ie date reads that variable, plex as you mentioned reads that variable (at least in some places).
Immich according to their docs should also read that variable ( ).

But, TZ variable will never update the /etc/timezone, nor docker does anything special with it.
Apps can totally ignore that variable if they choose to (can also ignore /etc/timezone), and there is nothing we can do about it.

However if you notice that the TZ variable is different from what you have set in the UI, we can take a look as this is most likely a bug.

*Note, TZ variable won’t affect the timestamp on docker logs.
Docker logs timestamps are always in UTC (https://github.com/docker/cli/issues/604)

Nikola Novakovic March 21, 2025 at 12:41 PM

I just noticed something, this issue seems to be on the system level. My timezone for truenas system is set to Louisville, KY, but /etc/timezone points to UTC (video attached)

Not Applicable

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

More fields

Katalon Platform

Created March 19, 2025 at 1:43 AM
Updated March 27, 2025 at 1:02 PM
Resolved March 27, 2025 at 1:01 PM