Time Zones

As stated previously, a time zone is just a positive or negative value combined with UTC. Once you set the time zone on a Linux system, applications will honor that positive or negative offset when they need to use a timestamp. The time zone on a Linux system is identified by the file /etc/localtime. This can be either a data file itself or a symbolic link to a data file in the directory /usr/share/zoneinfo.

/usr/share/zoneinfo contains files that represent every time zone. In order to set the time zone on your Linux system, you must either copy one of these files to /etc/localtime or create a symbolic link from /etc/localtime to one of these files. For example, if your system is in the United States in the Central time zone, your /etc/localtime file would look like this:

$ ls –l /etc/localtime
lrwxrwxrwx 1 root root 30 Sep 12 13:56 \
         /etc/localtime -> /usr/share/zoneinfo/US/Central

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.