Informationen/MiNT-Doc/

  FreeMiNT-Portal

System  Netzwerk   Tools   Programmierung   Distributionen    Informationen   Homepages

"timezone.doc" from the official MiNT-Documentation of the latest kernal release.

For questions, suggestions, critism etc. please email me.


[PREV]ssystem.doc unixmode.doc [NEXT]

The TZ Environment Variable
===========================

The POSIX standard allows two different formats for the value
of the TZ envariable.  If the value starts with a colon (`:')
its interpretation is system-dependent resp. implementation
dependent. 

However, this first format will most likely confuse the
other software on your system.  For now better stick to
the standard format:

	STD DST START END
	
The first part of the value is the abbrevation of the name
of your standard timezone, followed by the offset to
GMT.  

	Examples:
		
	GMT	- Greenwich Mean Time
	CET	- Central European Time
	EST	- Eastern Standard Time.
	
The offset to GMT is expressed as the time value that has to
be added to the local time to get a Coordinated Universal
Time value.  The exact syntax is

	[`+|-']HH[`:'MM[`:'SS]]

In other words:  A leading plus sign indicates that the timezone
is west of UTC and a leading minus describes an offset for a 
timezone east of UTC, followed by the number of hours and optionally
the number of minutes and again optionally by the number of
seconds.  All numbers may be padded with leading zeros and have
to be separated by a colon.

	CET-1
	CET-01
	CET-01:00
	CET-01:00:00	- CET has an offset of minus one hour to UTC.
	
	EST+5
	EST+05
	EST+05:0
	EST+05:00:0	- EST has an offset of plus five hours to UTC.
	
	GMT		- No offset!

These are actually the minimum requirements to the value of TZ.
(In fact the minimum setting is no setting at all resp. an
invalid or empty value in which case UTC is assumed).

But if you live in a time zone that has daylight savings time
you have to do a little bit more.  You should append the name
and optionally the offset of your alternative timezone to
the standard timezone (followed by no whitespace or other delimiters).
If you omit the offset of the alternative timezone it defaults
to one hour ahead of the standard timezone.  Thus
the following values are all equivalent:

	CET-1CETDST
	CET-1CETDST-2
	CET-1CETDST-02:00:00

They all describe the timezone CET which has an offset of
minus one hour to UTC and which knows a daylight savings
time during some part of the year which has an offset of
minus two hours.

Another example:

	GMT+0BST
	GMT-0BST
	
If you stop here the standard US rules for daylight savings
time apply, i.e. daylight savings time starts on the first
Sunday in April at 2:00am and ends on the last Sunday
in October at 2:00am.  

You can also specify the exact date and time when daylight 
savings time starts and end, both separated by a comma (',').  
The format is:

	DATE['/'TIME]

The date can be specified in three ways:

	`J'DAY	DAY is the day of the year.  February 29
	        is never counted even in leap years.
	        January 1 is represented by 1, December 31
	        is always 365.  Example:
	        
	        	CET-1CETDST,J97
	
	DAY	Without the leading `J' the interpretation is
		the same except that February 29 is counted
		in leap years.  Example:
		
			CET-1CETDST,98
		
	MM.W.D	MM is the month in the range of 1 to 12, W
		is the week of the month and D is the day
		of the week in the range between `0' (Sunday)
		and `6' (Saturday).  A week number of 5 always
		refers to the last occurence of the specified day 
		of the week in that particular month.  Example:
		
			CET-1CETDST,4.1.0
		
The date can optionally be followed by a slash ('/') and the
exact time of the day when the change takes place.  The semantics
of the time are the same as for offsets to UTC except that
no leading plus or minus is allowed.  Examples:

	CET-1CETDST-2,4.1.0/02:00:00

You can also specify the exact date and time when daylight 
savings time for your timezone ends:

	CET-1CETDST-2,4.1.0/02:00:00,10.5.0

Putting it all together:

	CET-01:00:00CETDST-02:00:00,J97/02:00:00,J300/02:00:00
	CET-01:00:00CETDST-02:00:00,98/02:00:00,301/02:00:00
	CET-01:00:00CETDST-02:00:00,4.1.0/02:00:00,10.5.0/02:00:00
	CET-1CETDST-2,4.1.0,10.5.0
	CET-1CETDST,4.1.0,10.5.0
	CET-1CETDST-2
	CET-1CETDST

These were all equivalent in the year 1996.  They always meant
then:  Change the timezone from CET to CETDST on the first Sunday
in April (or the 97th day of 1996 or the 98th day if you take
the leap day into account).  Change it back to CET on the last
Sunday in October (or 300th resp. 301st day).  All changes take
place at 2:00am, i.e. the local time warps from 2:00am on that
day in April and warps back from 3:00am to 2:00am in October.

BTW,  the correct setting for CET (in the European Community) should
be `CET-1CETDST,3.5.0,10.5.0' (prove me wrong...).

NOTE: As for patchlevel 46 the MiNTLib does not support specifying
the date and time of the changes between DST and standard time.

[PREV]ssystem.doc unixmode.doc [NEXT]

Last Update: Thu Apr 27 22:11 MET 2000     by AltF4@FreeMiNT.de