docker-chronyd icon indicating copy to clipboard operation
docker-chronyd copied to clipboard

TZ environment variable doesn`t work

Open gaows20 opened this issue 1 month ago • 1 comments

TZ=Asia/Shanghai

gaows20 avatar Nov 23 '25 16:11 gaows20

I've checked chronyd's source code and docs, but found no hint that it reacts the the TZ environment variable. The logs always use UTC timestamps. The time signal of NTP itself is of course always UTC.

The purpose of adding timezone data and why the TZ variable got documented is that for example the date command run inside of the container does respect the TZ setting. So it's for the supporting tools in the image, not chronyd itself.

There is one setting in chronyd called leapsectz, and if you want to change it, you can use the NTP_DIRECTIVES environment variable. You can set that to NTP_DIRECTIVES=leapsectz Asia/Shanghai, for example.

Or did you have something else in mind, that you had expected the TZ would influence?

simonrupf avatar Nov 25 '25 07:11 simonrupf