Posted by Midnight Sun on September 30, 1999 at 18:51:29: In Reply to: What does the DST is? posted by Nebo on September 30, 1999 at 14:15:33:
[info:(libc.info.gz)TZ Variable]
In POSIX.1 systems the value of the `TZ' variable can be of one of
three formats. With the GNU C library, the most common format is the
last one, which can specify a selection from a large database of time
zone information for many regions of the world. The first two formats
are used to describe the time zone information directly, which is both
more cumbersome and less precise. But the POSIX.1 standard only
specifies the details of the first two formats, so it is good to be
familiar with them in case you come across a POSIX.1 system that doesn't
support a time zone information database.
The first format is used when there is no Daylight Saving Time (or
summer time) in the local time zone:
STD OFFSET
The STD string specifies the name of the time zone. It must be
three or more characters long and must not contain a leading colon or
embedded digits, commas, or plus or minus signs. There is no space
character separating the time zone name from the OFFSET, so these
restrictions are necessary to parse the specification correctly.
The OFFSET specifies the time value one 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'.
For example, here is how we would specify Eastern Standard Time, but
without any daylight saving time alternative:
EST+5
The second format is used when there is Daylight Saving Time:
STD OFFSET DST [OFFSET]`,'START[`/'TIME]`,'END[`/'TIME]
The initial STD and OFFSET specify the standard time zone, as
described above. The DST string and OFFSET specify the name and offset
for the corresponding daylight saving time time zone; if the OFFSET is
omitted, it defaults to one hour ahead of standard time.
The remainder of the specification describes when daylight saving
time is in effect. The START field is when daylight saving time goes
into effect and the END field is when the change is made back to
standard time. The following formats are recognized for these fields: