TZ... Again

Simon Bowring pmmail@rpglink.com
Mon, 27 Mar 2000 10:08:18 +0000 (GMT)


On Sun, 26 Mar 2000 11:48:54 -0800, Marty Abrego wrote:

>
>I hate to bring up a potentially explosive topic (well, maybe not),
>but this should be an easily answered question.  During the previous
>TZ discussion, I think someone posted the long-form of the TZ
>variable for OS/2 -- you know, the one that says exactly what date
>and time to change to DST?  I searched through the old mail, but I
>couldn't find it.
>
>The thing is, today we are on DST, but OS/2 didn't change.  That's
>"normal", except that I am running Timekeeper/2 and I thought it
>would handle it.  It didn't, but I think it might have if it had the
>long-form instead of "pst8pdt" for TZ.  Anyone remember the long
>version??


The short answer is:

set TZ=gmt0bst,3,-1,0,7200,10,-1,0,10800,3600

The long answer is:

The TZ environment variable controls how to compute Coordinated
Universal Time (UTC aka GMT) from local time.  (Note that under Unix,
TZ is used for computing local time from UTC as UTC is used for the
system clock under Unix; under OS/2 and DOS, local time is used for
the system clock.) 

The value of TZ has the following format: 

TZ1[OFF,[TZ2[,SM,SW,SD,ST,EM,EW,ED,ET,SHIFT]]] 

TZ1 is the three-letter name of the standard timezone. 

OFF is the offset to Coordinated Universal Time; positive values are
to the west of the Prime Meridian, negative values are to the east of
the Prime Meridian.  The offset can be specified as hours, hours and
minutes, or hours, minutes, and seconds.  Hours, minutes, and seconds
are separated by colons.  If OFF is not specified, an offset of 0
will be used (this may change in the future).

TZ2 is the three-letter name of the summer timezone (daylight saving
time).  If TZ2 is not specified, daylight saving time does not apply.
 If TZ2 is specified, daylight saving time does apply; the remainder
of the TZ's value specifies when and how to change to and back from
daylight saving time. SM through ST define, in current local time,
when to switch from standard time to daylight saving time, EM through
ET define, in current local time, when to switch from daylight saving
time to standard time.  (On the southern hemisphere, the end date
precedes the start date.)  SHIFT is the amount of change in seconds. 

SM specifies the month (1 through 12) of the change.  SW specifies
the week of the change; if this value is zero, SD specifies the day
of month (1 through 31).  If SW is positive (1 through 4), the change
occurs on weekday SD (0=Sunday through 6=Saturday) of the SWth week
of the specified month.  The first week of a month starts on the
first Sunday of the month.  If SW is negative (-1 through -4), the
change occurs on weekday SD (0=Sunday through 6=Saturday) of the
-SWth week of the specified month, counted from the end of the month
(that is, -1 specifies the last week of the month).  The last week of
a month starts on the last Sunday of the month.  ST specifies the
time of the change, in seconds.  Note that ST is specified in local
standard time and ET is specified in local daylight saving time. 
Example: 

CET-1CED,3,-1,0,7200,10,-1,0,10800,3600
      
In this example, the name of the standard time zone is CET, the name
of the summer time zone is CED.  Daylight saving time starts at 2:00
on the last Sunday of March and ends at 3:00 on the last Sunday of
October.  Time changes by one hour in daylight saving time. 

If no characters follow TZ2, the rule `,4,1,0,3600,10,-1,0,7200,3600'
will be used: Daylight saving time starts at 1:00 on the first Sunday
of April and ends at 2:00 on the last Sunday of October.  Time
changes by one hour in daylight saving time. 



UK BST/GMT settings
-------------------

Daylight saving time starts at 2:00 on the last Sunday of March and ends 
at 2:00 on the last Sunday of October (EC standard).  Time changes by 
one hour in daylight saving time:

SET TZ=gmt0bst,3,-1,0,7200,10,-1,0,10800,3600