22.5.6 Specifying the Time Zone with TZ

In POSIX systems, a user can specify the time zone by means of the TZ environment variable. For information about how to set environment variables, see Environment Variables. The functions for accessing the time zone are declared in time.h.

You should not normally need to set TZ. If the system is configured properly, the default time zone will be correct. You might set TZ if you are using a computer over a network from a different time zone, and would like times reported to you in the time zone local to you, rather than what is local to the computer.

The value of TZ can be in one of the following formats:

If the TZ environment variable does not have a value, the implementation chooses a time zone by default. In the GNU C Library, the default time zone is like the specification ‘TZ=/etc/localtime’ (or ‘TZ=/usr/local/etc/localtime’, depending on how the GNU C Library was configured; see Installing the GNU C Library). Other C libraries use their own rule for choosing the default time zone, so there is little we can say about them.