linux time zones

I recently had to change the time zone on a linux server, and while linux handles time zones and locales well, changing the system’s time zone isn’t well documented.

I searched for a single command that would do it, probably run as root, but no luck. zdump(8), zic(8), and tzfile(5) have lots of good information, but none of them actually changes the time zone.

After some googling, I determined that /etc/localtime determines the system’s time zone. It’s usually a copy of or symlink to a file in /usr/share/zoneinfo. I ended up symlinking it to PST8PDT, for Pacific Time. If you’re in another time zone, the file names should be self-explanatory. (There’s more information on the debian-user mailing list.)

Many distributions come with tools for setting the time zone. Debian and Fedora have tzselect(8), which is marginally helpful. Debian also has tzconfig(8), which is much more useful.

Leave a Reply

Your email address will not be published. Required fields are marked *