I have a question about setting the correct timezone. The default is "UTC" and I want to set it to "UTC-8" so it matches my current timezone. All my logs/time indexes for my containers are wrong. I have tried "UTC-8" as well as "Canada/Vancouver". Restarted all services as instructed afterwards with no change. What is the correct syntax for setting timezones? Thanks!
8 replies
Seez wrote:
You need to use a "TZ identifier", you can find yours here: https://en.wikipedia.org/wiki/Listoftzdatabasetimezones
tomspark wrote:
Seez has it — SparkBox wants a timezone name, not an offset, so "UTC-8" just gets ignored. For Vancouver the exact value is America/Vancouver. But here's the part that actually got you: a restart won't apply a timezone change. Set the line in /opt/sparkbox/.env to TZ=America/Vancouver, then run: sudo sparkbox up That rebuilds the containers so they pick up the new zone — a plain restart keeps the old one, which is why nothing moved. Your logs should flip to Pacific time after that.
Big_Totoro wrote:
Hey Tom, I've made all those changes but my log times are still wrong and have not changed. I've done the "sparkbox up" and made the changes to the /opt/sparkbox/.env. Also restarted the entire system. Time is here 16:31 (When log shot was taken) Logs show 23:31 Any help is appreciated!
tomspark wrote:
That 7-hour gap means the container's still running on UTC, so the new timezone didn't actually take. The usual culprit: there are now TWO timezone lines in the file and the old one is winning. Run this and paste what it shows: grep -n TZ /opt/sparkbox/.env If you see two lines (a TZ=UTC and a TZ=America/Vancouver), that's it — delete the TZ=UTC line so only America/Vancouver is left, then run sudo sparkbox up again. If there's only the one line, tell me and we'll check the container directly.
Big_Totoro wrote:
Hey Tom, Only one TZ listed.
tomspark wrote:
Thanks — so the file is right, which means the container itself isn't picking the setting up. Let's see what it actually got. For the app where the time looks wrong, run these two (swap sb-audiobookshelf for whichever app it is — e.g. sb-sonarr, sb-radarr, sb-jellyfin): sudo docker exec sb-audiobookshelf printenv TZ sudo docker exec sb-audiobookshelf date Paste both lines. The first shows the timezone the container received; the second shows its actual clock. If the first says America/Vancouver but the clock is still UTC, that app just ignores the setting (some do). If the first is blank or UTC, the container didn't get rebuilt with the new value and we'll force it.
Big_Totoro wrote:
Hey Tom, Looks like both commands show the correct TZ and the correct time for me
tomspark wrote:
That's the good news — your container's now on Vancouver time, and the date command proves it. So the timezone change did take after all; the earlier wrong times were probably from before the rebuild finished. Pop back to wherever you first saw the times off — they should read correctly now. If one specific app's logs are still stuck on UTC, tell me which one: a handful of apps hard-code UTC in their own logs no matter the system timezone, and for those it's a setting inside that app rather than SparkBox. But for everything else, you're sorted. 🎉