TZ environment
Hi,
have some troubles regarding the timezone settings on a bunch of servers, running RHEL5.9.
The servers are located in Austria / CET, so I did the following timezone-configuration:
TZ=GMT+1
export TZ
Sadly, this setting does something wrong. The servers are now 1 hour behind GMT / 2 hours behind the local time (azores timezone).
I did a further test:
TZ=GMT-1
export TZ
Responses
For server-wide settings, you need to link /etc/localtime to the appropriate /usr/share/zoneinfo file. Use the time-configuration utility to make life easy on yourself. Setting TZ in a shell initilization script only effects the shell (and subhells) that sourced that initialization script.
Quoting "info libc 'Date and Time' 'Calendar Time' 'TZ Variable'":
The OFFSET specifies the time value you must add to the local time
to get a Coordinated Universal Time value. It has syntax like
[`+'|`-']HH[`:'MM[`:'SS]]. This is positive if the local time zone is
west of the Prime Meridian and negative if it is east. The hour must
be between `0' and `23', and the minute and seconds between `0' and
`59'.
Yes, this may be counterintuitive, but unfortunately this is what was codified in the relevant standard (POSIX.1).
I would recommend just setting TZ=Europe/Vienna instead.. no need to worry about the sign and having to update for daylight saving time.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
