.TH TIMEZONE "" "" "Environmental Variable"
.PC "Time zone information"
\fBTIMEZONE=\fIstandard\^\fB:\fIoffset\^\fB[:\fIdaylight\^\fB: \fIdate\^\fB:\fIdate\^\fB:\fIhour\^\fB:\fIminutes\^\fB]\fR
.PP
The \*(CO system records time internally as Greenwich Mean Time (GMT).
It does so to make it easier to coordinate exchange of information across
systems in different time zones around the world.
.PP
.B TIMEZONE
is an environmental parameter that holds
information about your local time zone.
This information is used by \*(CO's time routines
to convert GMT to the date and time in your local area.
.B TIMEZONE
takes into account your local time zone's offset from Greenwich,
whether your country uses daylight savings time, and the date and hour that
daylight savings time begins and ends.
.PP
To set
.BR TIMEZONE ,
use the command
.DS
	\fBexport TIMEZONE=[\fIdescription\^\fB]\fR
.DE
.PP
where \fIdescription\fR is the string that describes your time zone.
What this string consists of will be described below.
Most users write this command into the file
\fB.profile\fR,
so that
.B TIMEZONE
is set automatically whenever
they log onto the \*(CO system.
.PP
\*(CO's installation procedure creates file
.BR /etc/timezone ,
which sets
.BR TIMEZONE .
This file is executed by
.B /etc/profile
when each user logs in.
Thus, you must set the
.B TIMEZONE
in your
.B .profile
only if it
differs from the system's
.B TIMEZONE
as set in
.BR /etc/timezone .
This would be necessary if, for example, a user in New York were to regularly
login on a system in Chicago.
.SH "The Description String"
A \fBTIMEZONE\fR description string
consists of seven fields that are separated by colons.
Fields 1 and 2 must be filled; fields 3 through 7 are optional.
.PP
Field 1 gives the name of your standard time zone.
Field 2 gives the time zone's offset from Greenwich Mean Time in minutes.
Offsets are positive for time zones west of Greenwich and negative for
time zones east of Greenwich.
For example, users in Chicago set these fields as follows:
.DM
	TIMEZONE=CST:360
.DE
.PP
\fBCST\fR is an abbreviation for Central Standard Time, that
area's time zone; and 360 refers to the fact that Chicago's time
zone is 360 minutes (six hours) ahead of (that is, earlier than)
Greenwich.
.PP
Field 3
gives the name of the local daylight saving time zone.
In Chicago, for example, this field would be set as follows:
.DM
	TIMEZONE=CST:360:CDT
.DE
.PP
.B CDT
is an abbreviation for Central Daylight Time.
The absence of this field indicates that your area does not
use daylight saving time.
.PP
Fields 4 and 5
specify the dates on which daylight saving time begins and ends.
If field 3 is set but fields 4 and 5 are not,
changes between standard time and daylight saving time are
assumed to occur at the times legislated in the United States:
at 2 A.M. standard time on the first Sunday in April,
and at 2 A.M. daylight saving time on the last Sunday in October.
.PP
Fields 4 and 5
each consist of three numbers separated by periods.
The first number specifies which occurrence of the day in the month marks
the change, counting positive occurrences from the beginning of the
month and negative occurrences from the the end of the month.
The second number specifies a day of the week, numbering Sunday as one.
The third number specifies a month of the year, numbering January as one.
For example, in Chicago fields 4 and 5 are set to the following:
.DM
	TIMEZONE=CST:360:CDT:1.1.4:-1.1.10
.DE
.PP
If the first number in either field is set to zero,
then the last two numbers are assumed to indicate an absolute date.
This is done because some countries switch to daylight
saving time on the same day each year, instead of a given day of the week.
.PP
Finally, fields 6 and 7
specify the hour of the day at which daylight saving time
begins and ends, and the number of minutes of adjustment.
In Chicago, these are set as follows:
.DM
	TIMEZONE=CST:360:CDT:1.1.4:-1.1.10:2:60
.DE
.PP
The \*(Ql2\*(Qr of field 6 indicates that the switch to daylight savings
time occurs at 2 A.M.
The \*(QL60\*(QR of field 7 indicates that daylight savings time changes
the local time by 60 minutes.
Although 60 minutes is the standard change, some regions of the world
shift by 30, 45, 90, or 120 minutes; the last shift is also called
\*(QLdouble daylight saving time\*(QR.
.PP
For an example of this variable's use in a program, see the entry for
.BR asctime() .
.SH "See Also"
.Xr "environmental variables," environva
.Xr "time [overview]" time.a
.SH Notes
.II /etc/default/login
.II login
.II TZ
File
.B /etc/default/login
defines
.B TIMEZONE
differently:
it uses the same format as the \*(CO environmental variable
.BR TZ ,
which is set in file
.BR /etc/timezone .
Note that
.B TZ
and
.B TIMEZONE
as defined in
.B /etc/default/login
must be identical, or much confusion will result.
.PP
.II astrology
.II "Doane, Doris Chase"
For those requiring more information on this subject, much research has
been performed by astrologers.
See \fITime Changes in the World\fR, compiled by Doris Chase Doane
(three volumes, Hollywood, California, Professional Astrologers, Inc., 1970).
