head	1.5;
access;
symbols
	RELENG_8_4:1.5.0.2
	RELENG_8_3_0_RELEASE:1.3.2.2.6.1
	RELENG_8_3:1.3.2.2.0.6
	RELENG_8_3_BP:1.3.2.2
	RELENG_7_4_0_RELEASE:1.1.1.4.18.2.4.1
	RELENG_8_2_0_RELEASE:1.3.2.2.4.1
	RELENG_7_4:1.1.1.4.18.2.0.4
	RELENG_7_4_BP:1.1.1.4.18.2
	RELENG_8_2:1.3.2.2.0.4
	RELENG_8_2_BP:1.3.2.2
	RELENG_8_1_0_RELEASE:1.3.2.2.2.1
	RELENG_8_1:1.3.2.2.0.2
	RELENG_8_1_BP:1.3.2.2
	RELENG_7_3_0_RELEASE:1.1.1.4.18.2.2.1
	RELENG_7_3:1.1.1.4.18.2.0.2
	RELENG_7_3_BP:1.1.1.4.18.2
	RELENG_8_0_0_RELEASE:1.3.2.1.2.1
	RELENG_8_0:1.3.2.1.0.2
	RELENG_8_0_BP:1.3.2.1
	RELENG_8:1.3.0.2
	RELENG_8_BP:1.3
	RELENG_7_2_0_RELEASE:1.1.1.4
	RELENG_7_2:1.1.1.4.0.28
	RELENG_7_2_BP:1.1.1.4
	RELENG_7_1_0_RELEASE:1.1.1.4
	RELENG_6_4_0_RELEASE:1.1.1.4
	RELENG_7_1:1.1.1.4.0.26
	RELENG_7_1_BP:1.1.1.4
	RELENG_6_4:1.1.1.4.0.24
	RELENG_6_4_BP:1.1.1.4
	RELENG_7_0_0_RELEASE:1.1.1.4
	RELENG_6_3_0_RELEASE:1.1.1.4
	RELENG_7_0:1.1.1.4.0.22
	RELENG_7_0_BP:1.1.1.4
	RELENG_6_3:1.1.1.4.0.20
	RELENG_6_3_BP:1.1.1.4
	RELENG_7:1.1.1.4.0.18
	RELENG_7_BP:1.1.1.4
	RELENG_6_2_0_RELEASE:1.1.1.4
	RELENG_6_2:1.1.1.4.0.16
	RELENG_6_2_BP:1.1.1.4
	RELENG_5_5_0_RELEASE:1.1.1.4
	RELENG_5_5:1.1.1.4.0.14
	RELENG_5_5_BP:1.1.1.4
	RELENG_6_1_0_RELEASE:1.1.1.4
	RELENG_6_1:1.1.1.4.0.12
	RELENG_6_1_BP:1.1.1.4
	RELENG_6_0_0_RELEASE:1.1.1.4
	RELENG_6_0:1.1.1.4.0.10
	RELENG_6_0_BP:1.1.1.4
	RELENG_6:1.1.1.4.0.8
	RELENG_6_BP:1.1.1.4
	RELENG_5_4_0_RELEASE:1.1.1.4
	RELENG_5_4:1.1.1.4.0.6
	RELENG_5_4_BP:1.1.1.4
	RELENG_4_11_0_RELEASE:1.1.1.3
	RELENG_4_11:1.1.1.3.0.26
	RELENG_4_11_BP:1.1.1.3
	RELENG_5_3_0_RELEASE:1.1.1.4
	RELENG_5_3:1.1.1.4.0.4
	RELENG_5_3_BP:1.1.1.4
	RELENG_5:1.1.1.4.0.2
	RELENG_5_BP:1.1.1.4
	tzcode2004a:1.1.1.4
	RELENG_4_10_0_RELEASE:1.1.1.3
	RELENG_4_10:1.1.1.3.0.24
	RELENG_4_10_BP:1.1.1.3
	RELENG_5_2_1_RELEASE:1.1.1.3
	RELENG_5_2_0_RELEASE:1.1.1.3
	RELENG_5_2:1.1.1.3.0.22
	RELENG_5_2_BP:1.1.1.3
	RELENG_4_9_0_RELEASE:1.1.1.3
	RELENG_4_9:1.1.1.3.0.20
	RELENG_4_9_BP:1.1.1.3
	RELENG_5_1_0_RELEASE:1.1.1.3
	RELENG_5_1:1.1.1.3.0.18
	RELENG_5_1_BP:1.1.1.3
	RELENG_4_8_0_RELEASE:1.1.1.3
	RELENG_4_8:1.1.1.3.0.16
	RELENG_4_8_BP:1.1.1.3
	RELENG_5_0_0_RELEASE:1.1.1.3
	RELENG_5_0:1.1.1.3.0.14
	RELENG_5_0_BP:1.1.1.3
	RELENG_4_7_0_RELEASE:1.1.1.3
	RELENG_4_7:1.1.1.3.0.12
	RELENG_4_7_BP:1.1.1.3
	RELENG_4_6_2_RELEASE:1.1.1.3
	RELENG_4_6_1_RELEASE:1.1.1.3
	RELENG_4_6_0_RELEASE:1.1.1.3
	RELENG_4_6:1.1.1.3.0.10
	RELENG_4_6_BP:1.1.1.3
	RELENG_4_5_0_RELEASE:1.1.1.3
	RELENG_4_5:1.1.1.3.0.8
	RELENG_4_5_BP:1.1.1.3
	RELENG_4_4_0_RELEASE:1.1.1.3
	RELENG_4_4:1.1.1.3.0.6
	RELENG_4_4_BP:1.1.1.3
	RELENG_4_3_0_RELEASE:1.1.1.3
	RELENG_4_3:1.1.1.3.0.4
	RELENG_4_3_BP:1.1.1.3
	RELENG_4_2_0_RELEASE:1.1.1.3
	RELENG_4_1_1_RELEASE:1.1.1.3
	PRE_SMPNG:1.1.1.3
	RELENG_4_1_0_RELEASE:1.1.1.3
	RELENG_3_5_0_RELEASE:1.1.1.2
	RELENG_4_0_0_RELEASE:1.1.1.3
	RELENG_4:1.1.1.3.0.2
	RELENG_4_BP:1.1.1.3
	RELENG_3_4_0_RELEASE:1.1.1.2
	RELENG_3_3_0_RELEASE:1.1.1.2
	RELENG_3_2_PAO:1.1.1.2.0.6
	RELENG_3_2_PAO_BP:1.1.1.2
	RELENG_3_2_0_RELEASE:1.1.1.2
	RELENG_3_1_0_RELEASE:1.1.1.2
	tzcode1999a:1.1.1.3
	RELENG_3:1.1.1.2.0.4
	RELENG_3_BP:1.1.1.2
	RELENG_2_2_8_RELEASE:1.1.1.2
	RELENG_3_0_0_RELEASE:1.1.1.2
	RELENG_2_2_7_RELEASE:1.1.1.2
	RELENG_2_2_6_RELEASE:1.1.1.2
	RELENG_2_2_5_RELEASE:1.1.1.2
	RELENG_2_2_2_RELEASE:1.1.1.2
	RELENG_2_2_1_RELEASE:1.1.1.2
	RELENG_2_2_0_RELEASE:1.1.1.2
	RELENG_2_1_7_RELEASE:1.1.1.1
	RELENG_2_1_6_1_RELEASE:1.1.1.1
	RELENG_2_1_6_RELEASE:1.1.1.1
	RELENG_2_2:1.1.1.2.0.2
	RELENG_2_2_BP:1.1.1.2
	tzcode96h:1.1.1.2
	RELENG_2_1_5_RELEASE:1.1.1.1
	RELENG_2_1_0_RELEASE:1.1.1.1
	RELENG_2_1_0:1.1.1.1.0.6
	RELENG_2_1_0_BP:1.1.1.1
	RELENG_2_0_5_RELEASE:1.1.1.1
	RELENG_2_0_5:1.1.1.1.0.4
	RELENG_2_0_5_BP:1.1.1.1
	RELENG_2_0_5_ALPHA:1.1.1.1
	RELEASE_2_0:1.1.1.1
	BETA_2_0:1.1.1.1
	ALPHA_2_0:1.1.1.1.0.2
	tzcode94g:1.1.1.1
	ADO:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2010.02.25.21.10.27;	author edwin;	state dead;
branches
	1.5.2.1;
next	1.4;

1.4
date	2009.12.22.11.17.10;	author edwin;	state Exp;
branches;
next	1.3;

1.3
date	2009.05.27.12.18.39;	author edwin;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2009.05.23.06.31.50;	author edwin;	state Exp;
branches;
next	1.1;

1.1
date	94.09.13.03.29.23;	author wollman;	state Exp;
branches
	1.1.1.1;
next	;

1.5.2.1
date	2010.02.25.21.10.27;	author svnexp;	state dead;
branches;
next	1.5.2.2;

1.5.2.2
date	2013.03.28.13.06.28;	author svnexp;	state Exp;
branches;
next	;

1.3.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.3.2.1.2.1;
next	1.3.2.2;

1.3.2.2
date	2009.12.29.10.05.20;	author edwin;	state Exp;
branches
	1.3.2.2.2.1
	1.3.2.2.4.1
	1.3.2.2.6.1;
next	1.3.2.3;

1.3.2.3
date	2012.11.17.10.37.28;	author svnexp;	state Exp;
branches;
next	;

1.3.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.3.2.2.2.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.3.2.2.4.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.3.2.2.6.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.3.2.2.6.2;

1.3.2.2.6.2
date	2012.11.17.08.25.59;	author svnexp;	state Exp;
branches;
next	;

1.1.1.1
date	94.09.13.03.29.24;	author wollman;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	96.07.18.19.40.52;	author wollman;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	99.01.21.17.31.43;	author wollman;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2004.06.20.11.52.42;	author stefanf;	state Exp;
branches
	1.1.1.4.18.1;
next	;

1.1.1.4.18.1
date	2009.08.31.02.22.18;	author edwin;	state Exp;
branches;
next	1.1.1.4.18.2;

1.1.1.4.18.2
date	2009.12.29.10.05.43;	author edwin;	state Exp;
branches
	1.1.1.4.18.2.2.1
	1.1.1.4.18.2.4.1;
next	1.1.1.4.18.3;

1.1.1.4.18.3
date	2012.11.17.08.09.07;	author svnexp;	state Exp;
branches;
next	;

1.1.1.4.18.2.2.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.1.1.4.18.2.4.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.1.1.4.18.2.4.2;

1.1.1.4.18.2.4.2
date	2012.11.17.08.17.52;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.5
log
@SVN rev 204332 on 2010-02-25 21:10:27Z by edwin

From contrib/tzcode:
The Makefiles are leftovers from the copies and should live in usr.sbin/zic/*

From usr.sbin/zic:
The sources are from a vendor contributed source, therefore should
live in contrib/tzcode/zic.
@
text
@@@(#)Theory	8.4
This file is in the public domain, so clarified as of
2009-05-17 by Arthur David Olson.
$FreeBSD: src/usr.sbin/zic/Theory,v 1.4 2009/12/22 11:17:10 edwin Exp $

----- Outline -----

	Time and date functions
	Names of time zone regions
	Time zone abbreviations
	Calendrical issues
	Time and time zones on Mars

----- Time and date functions -----

These time and date functions are upwards compatible with POSIX,
an international standard for UNIX-like systems.
As of this writing, the current edition of POSIX is:

  Standard for Information technology
  -- Portable Operating System Interface (POSIX (R))
  -- System Interfaces
  IEEE Std 1003.1, 2004 Edition
  <http://www.opengroup.org/online-pubs?DOC=7999959899>
  <http://www.opengroup.org/pubs/catalog/t041.htm>

POSIX has the following properties and limitations.

*	In POSIX, time display in a process is controlled by the
	environment variable TZ.  Unfortunately, the POSIX TZ string takes
	a form that is hard to describe and is error-prone in practice.
	Also, POSIX TZ strings can't deal with other (for example, Israeli)
	daylight saving time rules, or situations where more than two
	time zone abbreviations are used in an area.

	The POSIX TZ string takes the following form:

		stdoffset[dst[offset],date[/time],date[/time]]

	where:

	std and dst
		are 3 or more characters specifying the standard
		and daylight saving time (DST) zone names.
		Starting with POSIX.1-2001, std and dst may also be
		in a quoted form like "<UTC+10>"; this allows
		"+" and "-" in the names.
	offset
		is of the form `[-]hh:[mm[:ss]]' and specifies the
		offset west of UTC.  The default DST offset is one hour
		ahead of standard time.
	date[/time],date[/time]
		specifies the beginning and end of DST.  If this is absent,
		the system supplies its own rules for DST, and these can
		differ from year to year; typically US DST rules are used.
	time
		takes the form `hh:[mm[:ss]]' and defaults to 02:00.
	date
		takes one of the following forms:
		Jn (1<=n<=365)
			origin-1 day number not counting February 29
		n (0<=n<=365)
			origin-0 day number counting February 29 if present
		Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
			for the dth day of week n of month m of the year,
			where week 1 is the first week in which day d appears,
			and `5' stands for the last week in which day d appears
			(which may be either the 4th or 5th week).

	Here is an example POSIX TZ string, for US Pacific time using rules
	appropriate from 1987 through 2006:

		TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'

	This POSIX TZ string is hard to remember, and mishandles time stamps
	before 1987 and after 2006.  With this package you can use this
	instead:

		TZ='America/Los_Angeles'

*	POSIX does not define the exact meaning of TZ values like "EST5EDT".
	Typically the current US DST rules are used to interpret such values,
	but this means that the US DST rules are compiled into each program
	that does time conversion.  This means that when US time conversion
	rules change (as in the United States in 1987), all programs that
	do time conversion must be recompiled to ensure proper results.

*	In POSIX, there's no tamper-proof way for a process to learn the
	system's best idea of local wall clock.  (This is important for
	applications that an administrator wants used only at certain times--
	without regard to whether the user has fiddled the "TZ" environment
	variable.  While an administrator can "do everything in UTC" to get
	around the problem, doing so is inconvenient and precludes handling
	daylight saving time shifts--as might be required to limit phone
	calls to off-peak hours.)

*	POSIX requires that systems ignore leap seconds.

These are the extensions that have been made to the POSIX functions:

*	The "TZ" environment variable is used in generating the name of a file
	from which time zone information is read (or is interpreted a la
	POSIX); "TZ" is no longer constrained to be a three-letter time zone
	name followed by a number of hours and an optional three-letter
	daylight time zone name.  The daylight saving time rules to be used
	for a particular time zone are encoded in the time zone file;
	the format of the file allows U.S., Australian, and other rules to be
	encoded, and allows for situations where more than two time zone
	abbreviations are used.

	It was recognized that allowing the "TZ" environment variable to
	take on values such as "America/New_York" might cause "old" programs
	(that expect "TZ" to have a certain form) to operate incorrectly;
	consideration was given to using some other environment variable
	(for example, "TIMEZONE") to hold the string used to generate the
	time zone information file name.  In the end, however, it was decided
	to continue using "TZ":  it is widely used for time zone purposes;
	separately maintaining both "TZ" and "TIMEZONE" seemed a nuisance;
	and systems where "new" forms of "TZ" might cause problems can simply
	use TZ values such as "EST5EDT" which can be used both by
	"new" programs (a la POSIX) and "old" programs (as zone names and
	offsets).

*	To handle places where more than two time zone abbreviations are used,
	the functions "localtime" and "gmtime" set tzname[tmp->tm_isdst]
	(where "tmp" is the value the function returns) to the time zone
	abbreviation to be used.  This differs from POSIX, where the elements
	of tzname are only changed as a result of calls to tzset.

*	Since the "TZ" environment variable can now be used to control time
	conversion, the "daylight" and "timezone" variables are no longer
	needed.  (These variables are defined and set by "tzset"; however, their
	values will not be used by "localtime.")

*	The "localtime" function has been set up to deliver correct results
	for near-minimum or near-maximum time_t values.  (A comment in the
	source code tells how to get compatibly wrong results).

*	A function "tzsetwall" has been added to arrange for the system's
	best approximation to local wall clock time to be delivered by
	subsequent calls to "localtime."  Source code for portable
	applications that "must" run on local wall clock time should call
	"tzsetwall();" if such code is moved to "old" systems that don't
	provide tzsetwall, you won't be able to generate an executable program.
	(These time zone functions also arrange for local wall clock time to be
	used if tzset is called--directly or indirectly--and there's no "TZ"
	environment variable; portable applications should not, however, rely
	on this behavior since it's not the way SVR2 systems behave.)

*	These functions can account for leap seconds, thanks to Bradley White.

Points of interest to folks with other systems:

*	This package is already part of many POSIX-compliant hosts,
	including BSD, HP, Linux, Network Appliance, SCO, SGI, and Sun.
	On such hosts, the primary use of this package
	is to update obsolete time zone rule tables.
	To do this, you may need to compile the time zone compiler
	`zic' supplied with this package instead of using the system `zic',
	since the format of zic's input changed slightly in late 1994,
	and many vendors still do not support the new input format.

*	The UNIX Version 7 "timezone" function is not present in this package;
	it's impossible to reliably map timezone's arguments (a "minutes west
	of GMT" value and a "daylight saving time in effect" flag) to a
	time zone abbreviation, and we refuse to guess.
	Programs that in the past used the timezone function may now examine
	tzname[localtime(&clock)->tm_isdst] to learn the correct time
	zone abbreviation to use.  Alternatively, use
	localtime(&clock)->tm_zone if this has been enabled.

*	The 4.2BSD gettimeofday function is not used in this package.
	This formerly let users obtain the current UTC offset and DST flag,
	but this functionality was removed in later versions of BSD.

*	In SVR2, time conversion fails for near-minimum or near-maximum
	time_t values when doing conversions for places that don't use UTC.
	This package takes care to do these conversions correctly.

The functions that are conditionally compiled if STD_INSPIRED is defined
should, at this point, be looked on primarily as food for thought.  They are
not in any sense "standard compatible"--some are not, in fact, specified in
*any* standard.  They do, however, represent responses of various authors to
standardization proposals.

Other time conversion proposals, in particular the one developed by folks at
Hewlett Packard, offer a wider selection of functions that provide capabilities
beyond those provided here.  The absence of such functions from this package
is not meant to discourage the development, standardization, or use of such
functions.  Rather, their absence reflects the decision to make this package
contain valid extensions to POSIX, to ensure its broad acceptability.  If
more powerful time conversion functions can be standardized, so much the
better.


----- Names of time zone rule files -----

The time zone rule file naming conventions attempt to strike a balance
among the following goals:

 * Uniquely identify every national region where clocks have all
   agreed since 1970.  This is essential for the intended use: static
   clocks keeping local civil time.

 * Indicate to humans as to where that region is.  This simplifes use.

 * Be robust in the presence of political changes.  This reduces the
   number of updates and backward-compatibility hacks.  For example,
   names of countries are ordinarily not used, to avoid
   incompatibilities when countries change their name
   (e.g. Zaire->Congo) or when locations change countries
   (e.g. Hong Kong from UK colony to China).

 * Be portable to a wide variety of implementations.
   This promotes use of the technology.

 * Use a consistent naming convention over the entire world.
   This simplifies both use and maintenance.

This naming convention is not intended for use by inexperienced users
to select TZ values by themselves (though they can of course examine
and reuse existing settings).  Distributors should provide
documentation and/or a simple selection interface that explains the
names; see the 'tzselect' program supplied with this distribution for
one example.

Names normally have the form AREA/LOCATION, where AREA is the name
of a continent or ocean, and LOCATION is the name of a specific
location within that region.  North and South America share the same
area, `America'.  Typical names are `Africa/Cairo', `America/New_York',
and `Pacific/Honolulu'.

Here are the general rules used for choosing location names,
in decreasing order of importance:

	Use only valid POSIX file name components (i.e., the parts of
		names other than `/').  Within a file name component,
		use only ASCII letters, `.', `-' and `_'.  Do not use
		digits, as that might create an ambiguity with POSIX
		TZ strings.  A file name component must not exceed 14
		characters or start with `-'.  E.g., prefer `Brunei'
		to `Bandar_Seri_Begawan'.
	Include at least one location per time zone rule set per country.
		One such location is enough.  Use ISO 3166 (see the file
		iso3166.tab) to help decide whether something is a country.
		However, uninhabited ISO 3166 regions like Bouvet Island
		do not need locations, since local time is not defined there.
	If all the clocks in a country's region have agreed since 1970,
		don't bother to include more than one location
		even if subregions' clocks disagreed before 1970.
		Otherwise these tables would become annoyingly large.
	If a name is ambiguous, use a less ambiguous alternative;
		e.g. many cities are named San Jose and Georgetown, so
		prefer `Costa_Rica' to `San_Jose' and `Guyana' to `Georgetown'.
	Keep locations compact.  Use cities or small islands, not countries
		or regions, so that any future time zone changes do not split
		locations into different time zones.  E.g. prefer `Paris'
		to `France', since France has had multiple time zones.
	Use mainstream English spelling, e.g. prefer `Rome' to `Roma', and
		prefer `Athens' to the true name (which uses Greek letters).
		The POSIX file name restrictions encourage this rule.
	Use the most populous among locations in a country's time zone,
		e.g. prefer `Shanghai' to `Beijing'.  Among locations with
		similar populations, pick the best-known location,
		e.g. prefer `Rome' to `Milan'.
	Use the singular form, e.g. prefer `Canary' to `Canaries'.
	Omit common suffixes like `_Islands' and `_City', unless that
		would lead to ambiguity.  E.g. prefer `Cayman' to
		`Cayman_Islands' and `Guatemala' to `Guatemala_City',
		but prefer `Mexico_City' to `Mexico' because the country
		of Mexico has several time zones.
	Use `_' to represent a space.
	Omit `.' from abbreviations in names, e.g. prefer `St_Helena'
		to `St._Helena'.
	Do not change established names if they only marginally
		violate the above rules.  For example, don't change
		the existing name `Rome' to `Milan' merely because
		Milan's population has grown to be somewhat greater
		than Rome's.
	If a name is changed, put its old spelling in the `backward' file.

The file `zone.tab' lists the geographical locations used to name
time zone rule files.  It is intended to be an exhaustive list
of canonical names for geographic regions.

Older versions of this package used a different naming scheme,
and these older names are still supported.
See the file `backward' for most of these older names
(e.g. `US/Eastern' instead of `America/New_York').
The other old-fashioned names still supported are
`WET', `CET', `MET', `EET' (see the file `europe'),
and `Factory' (see the file `factory').


----- Time zone abbreviations -----

When this package is installed, it generates time zone abbreviations
like `EST' to be compatible with human tradition and POSIX.
Here are the general rules used for choosing time zone abbreviations,
in decreasing order of importance:

	Use abbreviations that consist of three or more ASCII letters.
		Previous editions of this database also used characters like
		' ' and '?', but these characters have a special meaning to
		the shell and cause commands like
			set `date`
		to have unexpected effects.
		Previous editions of this rule required upper-case letters,
		but the Congressman who introduced Chamorro Standard Time
		preferred "ChST", so the rule has been relaxed.

		This rule guarantees that all abbreviations could have
		been specified by a POSIX TZ string.  POSIX
		requires at least three characters for an
		abbreviation.  POSIX through 2000 says that an abbreviation
		cannot start with ':', and cannot contain ',', '-',
		'+', NUL, or a digit.  POSIX from 2001 on changes this
		rule to say that an abbreviation can contain only '-', '+',
		and alphanumeric characters from the portable character set
		in the current locale.  To be portable to both sets of
		rules, an abbreviation must therefore use only ASCII
		letters.

	Use abbreviations that are in common use among English-speakers,
		e.g. `EST' for Eastern Standard Time in North America.
		We assume that applications translate them to other languages
		as part of the normal localization process; for example,
		a French application might translate `EST' to `HNE'.

	For zones whose times are taken from a city's longitude, use the
		traditional xMT notation, e.g. `PMT' for Paris Mean Time.
		The only name like this in current use is `GMT'.

	If there is no common English abbreviation, abbreviate the English
		translation of the usual phrase used by native speakers.
		If this is not available or is a phrase mentioning the country
		(e.g. ``Cape Verde Time''), then:

		When a country has a single or principal time zone region,
			append `T' to the country's ISO	code, e.g. `CVT' for
			Cape Verde Time.  For summer time append `ST';
			for double summer time append `DST'; etc.
		When a country has multiple time zones, take the first three
			letters of an English place name identifying each zone
			and then append `T', `ST', etc. as before;
			e.g. `VLAST' for VLAdivostok Summer Time.

	Use UTC (with time zone abbreviation "zzz") for locations while
		uninhabited.  The "zzz" mnemonic is that these locations are,
		in some sense, asleep.

Application writers should note that these abbreviations are ambiguous
in practice: e.g. `EST' has a different meaning in Australia than
it does in the United States.  In new applications, it's often better
to use numeric UTC offsets like `-0500' instead of time zone
abbreviations like `EST'; this avoids the ambiguity.


----- Calendrical issues -----

Calendrical issues are a bit out of scope for a time zone database,
but they indicate the sort of problems that we would run into if we
extended the time zone database further into the past.  An excellent
resource in this area is Nachum Dershowitz and Edward M. Reingold,
<a href="http://emr.cs.iit.edu/home/reingold/calendar-book/third-edition/">
Calendrical Calculations: Third Edition
</a>, Cambridge University Press (2008).  Other information and
sources are given below.  They sometimes disagree.


France

Gregorian calendar adopted 1582-12-20.
French Revolutionary calendar used 1793-11-24 through 1805-12-31,
and (in Paris only) 1871-05-06 through 1871-05-23.


Russia

From Chris Carrier (1996-12-02):
On 1929-10-01 the Soviet Union instituted an ``Eternal Calendar''
with 30-day months plus 5 holidays, with a 5-day week.
On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
reverted to the 7-day week.  With the 6-day week the usual days
off were the 6th, 12th, 18th, 24th and 30th of the month.
(Source: Evitiar Zerubavel, _The Seven Day Circle_)


Mark Brader reported a similar story in "The Book of Calendars", edited
by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377.  But:

From: Petteri Sulonen (via Usenet)
Date: 14 Jan 1999 00:00:00 GMT
...

If your source is correct, how come documents between 1929 -- 1940 were
still dated using the conventional, Gregorian calendar?

I can post a scan of a document dated December 1, 1934, signed by
Yenukidze, the secretary, on behalf of Kalinin, the President of the
Executive Committee of the Supreme Soviet, if you like.



Sweden (and Finland)

From: Mark Brader
<a href="news:1996Jul6.012937.29190@@sq.com">
Subject: Re: Gregorian reform -- a part of locale?
</a>
Date: 1996-07-06

In 1700, Denmark made the transition from Julian to Gregorian.  Sweden
decided to *start* a transition in 1700 as well, but rather than have one of
those unsightly calendar gaps :-), they simply decreed that the next leap
year after 1696 would be in 1744 -- putting the whole country on a calendar
different from both Julian and Gregorian for a period of 40 years.

However, in 1704 something went wrong and the plan was not carried through;
they did, after all, have a leap year that year.  And one in 1708.  In 1712
they gave it up and went back to Julian, putting 30 days in February that
year!...

Then in 1753, Sweden made the transition to Gregorian in the usual manner,
getting there only 13 years behind the original schedule.

(A previous posting of this story was challenged, and Swedish readers
produced the following references to support it: "Tiderakning och historia"
by Natanael Beckman (1924) and "Tid, en bok om tiderakning och
kalendervasen" by Lars-Olof Lode'n (no date was given).)


Grotefend's data

From: "Michael Palmer" [with one obvious typo fixed]
Subject: Re: Gregorian Calendar (was Re: Another FHC related question
Newsgroups: soc.genealogy.german
Date: Tue, 9 Feb 1999 02:32:48 -800
...

The following is a(n incomplete) listing, arranged chronologically, of
European states, with the date they converted from the Julian to the
Gregorian calendar:

04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
                 Catholics and Danzig only)
09/20 Dec 1582 - France, Lorraine

21 Dec 1582/
   01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
10/21 Feb 1583 - bishopric of Liege (L"uttich)
13/24 Feb 1583 - bishopric of Augsburg
04/15 Oct 1583 - electorate of Trier
05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
                 Salzburg, Brixen
13/24 Oct 1583 - Austrian Oberelsass and Breisgau
20/31 Oct 1583 - bishopric of Basel
02/13 Nov 1583 - duchy of J"ulich-Berg
02/13 Nov 1583 - electorate and city of K"oln
04/15 Nov 1583 - bishopric of W"urzburg
11/22 Nov 1583 - electorate of Mainz
16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
17/28 Nov 1583 - bishopric of M"unster and duchy of Cleve
14/25 Dec 1583 - Steiermark

06/17 Jan 1584 - Austria and Bohemia
11/22 Jan 1584 - Luzern, Uri, Schwyz, Zug, Freiburg, Solothurn
12/23 Jan 1584 - Silesia and the Lausitz
22 Jan/
   02 Feb 1584 - Hungary (legally on 21 Oct 1587)
      Jun 1584 - Unterwalden
01/12 Jul 1584 - duchy of Westfalen

16/27 Jun 1585 - bishopric of Paderborn

14/25 Dec 1590 - Transylvania

22 Aug/
   02 Sep 1612 - duchy of Prussia

13/24 Dec 1614 - Pfalz-Neuburg

          1617 - duchy of Kurland (reverted to the Julian calendar in
                 1796)

          1624 - bishopric of Osnabr"uck

          1630 - bishopric of Minden

15/26 Mar 1631 - bishopric of Hildesheim

          1655 - Kanton Wallis

05/16 Feb 1682 - city of Strassburg

18 Feb/
   01 Mar 1700 - Protestant Germany (including Swedish possessions in
                 Germany), Denmark, Norway
30 Jun/
   12 Jul 1700 - Gelderland, Zutphen
10 Nov/
   12 Dec 1700 - Utrecht, Overijssel

31 Dec 1700/
   12 Jan 1701 - Friesland, Groningen, Z"urich, Bern, Basel, Geneva,
                 Turgau, and Schaffhausen

          1724 - Glarus, Appenzell, and the city of St. Gallen

01 Jan 1750    - Pisa and Florence

02/14 Sep 1752 - Great Britain

17 Feb/
   01 Mar 1753 - Sweden

1760-1812      - Graub"unden

The Russian empire (including Finland and the Baltic states) did not
convert to the Gregorian calendar until the Soviet revolution of 1917.

Source:  H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
(Hannover:  Hahnsche Buchhandlung, 1941), pp. 26-28.


----- Time and time zones on Mars -----

Some people have adjusted their work schedules to fit Mars time.
Dozens of special Mars watches were built for Jet Propulsion
Laboratory workers who kept Mars time during the Mars Exploration
Rovers mission (2004).  These timepieces look like normal Seikos and
Citizens but use Mars seconds rather than terrestrial seconds.

A Mars solar day is called a "sol" and has a mean period equal to
about 24 hours 39 minutes 35.244 seconds in terrestrial time.  It is
divided into a conventional 24-hour clock, so each Mars second equals
about 1.02749125 terrestrial seconds.

The prime meridian of Mars goes through the center of the crater
Airy-0, named in honor of the British astronomer who built the
Greenwich telescope that defines Earth's prime meridian.  Mean solar
time on the Mars prime meridian is called Mars Coordinated Time (MTC).

Each landed mission on Mars has adopted a different reference for
solar time keeping, so there is no real standard for Mars time zones.
For example, the Mars Exploration Rover project (2004) defined two
time zones "Local Solar Time A" and "Local Solar Time B" for its two
missions, each zone designed so that its time equals local true solar
time at approximately the middle of the nominal mission.  Such a "time
zone" is not particularly suited for any application other than the
mission itself.

Many calendars have been proposed for Mars, but none have achieved
wide acceptance.  Astronomers often use Mars Sol Date (MSD) which is a
sequential count of Mars solar days elapsed since about 1873-12-29
12:00 GMT.

The tz database does not currently support Mars time, but it is
documented here in the hopes that support will be added eventually.

Sources:

Michael Allison and Robert Schmunk,
"Technical Notes on Mars Solar Time as Adopted by the Mars24 Sunclock"
<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-07-30).

Jia-Rui Chong, "Workdays Fit for a Martian", Los Angeles Times
(2004-01-14), pp A1, A20-A21.
@


1.5.2.1
log
@file Theory was added on branch RELENG_8_4 on 2013-03-28 13:06:28 +0000
@
text
@d1 570
@


1.5.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 570
@@(#)Theory	8.4
This file is in the public domain, so clarified as of
2009-05-17 by Arthur David Olson.
$FreeBSD: releng/8.4/usr.sbin/zic/Theory 201183 2009-12-29 10:05:20Z edwin $

----- Outline -----

	Time and date functions
	Names of time zone regions
	Time zone abbreviations
	Calendrical issues
	Time and time zones on Mars

----- Time and date functions -----

These time and date functions are upwards compatible with POSIX,
an international standard for UNIX-like systems.
As of this writing, the current edition of POSIX is:

  Standard for Information technology
  -- Portable Operating System Interface (POSIX (R))
  -- System Interfaces
  IEEE Std 1003.1, 2004 Edition
  <http://www.opengroup.org/online-pubs?DOC=7999959899>
  <http://www.opengroup.org/pubs/catalog/t041.htm>

POSIX has the following properties and limitations.

*	In POSIX, time display in a process is controlled by the
	environment variable TZ.  Unfortunately, the POSIX TZ string takes
	a form that is hard to describe and is error-prone in practice.
	Also, POSIX TZ strings can't deal with other (for example, Israeli)
	daylight saving time rules, or situations where more than two
	time zone abbreviations are used in an area.

	The POSIX TZ string takes the following form:

		stdoffset[dst[offset],date[/time],date[/time]]

	where:

	std and dst
		are 3 or more characters specifying the standard
		and daylight saving time (DST) zone names.
		Starting with POSIX.1-2001, std and dst may also be
		in a quoted form like "<UTC+10>"; this allows
		"+" and "-" in the names.
	offset
		is of the form `[-]hh:[mm[:ss]]' and specifies the
		offset west of UTC.  The default DST offset is one hour
		ahead of standard time.
	date[/time],date[/time]
		specifies the beginning and end of DST.  If this is absent,
		the system supplies its own rules for DST, and these can
		differ from year to year; typically US DST rules are used.
	time
		takes the form `hh:[mm[:ss]]' and defaults to 02:00.
	date
		takes one of the following forms:
		Jn (1<=n<=365)
			origin-1 day number not counting February 29
		n (0<=n<=365)
			origin-0 day number counting February 29 if present
		Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
			for the dth day of week n of month m of the year,
			where week 1 is the first week in which day d appears,
			and `5' stands for the last week in which day d appears
			(which may be either the 4th or 5th week).

	Here is an example POSIX TZ string, for US Pacific time using rules
	appropriate from 1987 through 2006:

		TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'

	This POSIX TZ string is hard to remember, and mishandles time stamps
	before 1987 and after 2006.  With this package you can use this
	instead:

		TZ='America/Los_Angeles'

*	POSIX does not define the exact meaning of TZ values like "EST5EDT".
	Typically the current US DST rules are used to interpret such values,
	but this means that the US DST rules are compiled into each program
	that does time conversion.  This means that when US time conversion
	rules change (as in the United States in 1987), all programs that
	do time conversion must be recompiled to ensure proper results.

*	In POSIX, there's no tamper-proof way for a process to learn the
	system's best idea of local wall clock.  (This is important for
	applications that an administrator wants used only at certain times--
	without regard to whether the user has fiddled the "TZ" environment
	variable.  While an administrator can "do everything in UTC" to get
	around the problem, doing so is inconvenient and precludes handling
	daylight saving time shifts--as might be required to limit phone
	calls to off-peak hours.)

*	POSIX requires that systems ignore leap seconds.

These are the extensions that have been made to the POSIX functions:

*	The "TZ" environment variable is used in generating the name of a file
	from which time zone information is read (or is interpreted a la
	POSIX); "TZ" is no longer constrained to be a three-letter time zone
	name followed by a number of hours and an optional three-letter
	daylight time zone name.  The daylight saving time rules to be used
	for a particular time zone are encoded in the time zone file;
	the format of the file allows U.S., Australian, and other rules to be
	encoded, and allows for situations where more than two time zone
	abbreviations are used.

	It was recognized that allowing the "TZ" environment variable to
	take on values such as "America/New_York" might cause "old" programs
	(that expect "TZ" to have a certain form) to operate incorrectly;
	consideration was given to using some other environment variable
	(for example, "TIMEZONE") to hold the string used to generate the
	time zone information file name.  In the end, however, it was decided
	to continue using "TZ":  it is widely used for time zone purposes;
	separately maintaining both "TZ" and "TIMEZONE" seemed a nuisance;
	and systems where "new" forms of "TZ" might cause problems can simply
	use TZ values such as "EST5EDT" which can be used both by
	"new" programs (a la POSIX) and "old" programs (as zone names and
	offsets).

*	To handle places where more than two time zone abbreviations are used,
	the functions "localtime" and "gmtime" set tzname[tmp->tm_isdst]
	(where "tmp" is the value the function returns) to the time zone
	abbreviation to be used.  This differs from POSIX, where the elements
	of tzname are only changed as a result of calls to tzset.

*	Since the "TZ" environment variable can now be used to control time
	conversion, the "daylight" and "timezone" variables are no longer
	needed.  (These variables are defined and set by "tzset"; however, their
	values will not be used by "localtime.")

*	The "localtime" function has been set up to deliver correct results
	for near-minimum or near-maximum time_t values.  (A comment in the
	source code tells how to get compatibly wrong results).

*	A function "tzsetwall" has been added to arrange for the system's
	best approximation to local wall clock time to be delivered by
	subsequent calls to "localtime."  Source code for portable
	applications that "must" run on local wall clock time should call
	"tzsetwall();" if such code is moved to "old" systems that don't
	provide tzsetwall, you won't be able to generate an executable program.
	(These time zone functions also arrange for local wall clock time to be
	used if tzset is called--directly or indirectly--and there's no "TZ"
	environment variable; portable applications should not, however, rely
	on this behavior since it's not the way SVR2 systems behave.)

*	These functions can account for leap seconds, thanks to Bradley White.

Points of interest to folks with other systems:

*	This package is already part of many POSIX-compliant hosts,
	including BSD, HP, Linux, Network Appliance, SCO, SGI, and Sun.
	On such hosts, the primary use of this package
	is to update obsolete time zone rule tables.
	To do this, you may need to compile the time zone compiler
	`zic' supplied with this package instead of using the system `zic',
	since the format of zic's input changed slightly in late 1994,
	and many vendors still do not support the new input format.

*	The UNIX Version 7 "timezone" function is not present in this package;
	it's impossible to reliably map timezone's arguments (a "minutes west
	of GMT" value and a "daylight saving time in effect" flag) to a
	time zone abbreviation, and we refuse to guess.
	Programs that in the past used the timezone function may now examine
	tzname[localtime(&clock)->tm_isdst] to learn the correct time
	zone abbreviation to use.  Alternatively, use
	localtime(&clock)->tm_zone if this has been enabled.

*	The 4.2BSD gettimeofday function is not used in this package.
	This formerly let users obtain the current UTC offset and DST flag,
	but this functionality was removed in later versions of BSD.

*	In SVR2, time conversion fails for near-minimum or near-maximum
	time_t values when doing conversions for places that don't use UTC.
	This package takes care to do these conversions correctly.

The functions that are conditionally compiled if STD_INSPIRED is defined
should, at this point, be looked on primarily as food for thought.  They are
not in any sense "standard compatible"--some are not, in fact, specified in
*any* standard.  They do, however, represent responses of various authors to
standardization proposals.

Other time conversion proposals, in particular the one developed by folks at
Hewlett Packard, offer a wider selection of functions that provide capabilities
beyond those provided here.  The absence of such functions from this package
is not meant to discourage the development, standardization, or use of such
functions.  Rather, their absence reflects the decision to make this package
contain valid extensions to POSIX, to ensure its broad acceptability.  If
more powerful time conversion functions can be standardized, so much the
better.


----- Names of time zone rule files -----

The time zone rule file naming conventions attempt to strike a balance
among the following goals:

 * Uniquely identify every national region where clocks have all
   agreed since 1970.  This is essential for the intended use: static
   clocks keeping local civil time.

 * Indicate to humans as to where that region is.  This simplifes use.

 * Be robust in the presence of political changes.  This reduces the
   number of updates and backward-compatibility hacks.  For example,
   names of countries are ordinarily not used, to avoid
   incompatibilities when countries change their name
   (e.g. Zaire->Congo) or when locations change countries
   (e.g. Hong Kong from UK colony to China).

 * Be portable to a wide variety of implementations.
   This promotes use of the technology.

 * Use a consistent naming convention over the entire world.
   This simplifies both use and maintenance.

This naming convention is not intended for use by inexperienced users
to select TZ values by themselves (though they can of course examine
and reuse existing settings).  Distributors should provide
documentation and/or a simple selection interface that explains the
names; see the 'tzselect' program supplied with this distribution for
one example.

Names normally have the form AREA/LOCATION, where AREA is the name
of a continent or ocean, and LOCATION is the name of a specific
location within that region.  North and South America share the same
area, `America'.  Typical names are `Africa/Cairo', `America/New_York',
and `Pacific/Honolulu'.

Here are the general rules used for choosing location names,
in decreasing order of importance:

	Use only valid POSIX file name components (i.e., the parts of
		names other than `/').  Within a file name component,
		use only ASCII letters, `.', `-' and `_'.  Do not use
		digits, as that might create an ambiguity with POSIX
		TZ strings.  A file name component must not exceed 14
		characters or start with `-'.  E.g., prefer `Brunei'
		to `Bandar_Seri_Begawan'.
	Include at least one location per time zone rule set per country.
		One such location is enough.  Use ISO 3166 (see the file
		iso3166.tab) to help decide whether something is a country.
		However, uninhabited ISO 3166 regions like Bouvet Island
		do not need locations, since local time is not defined there.
	If all the clocks in a country's region have agreed since 1970,
		don't bother to include more than one location
		even if subregions' clocks disagreed before 1970.
		Otherwise these tables would become annoyingly large.
	If a name is ambiguous, use a less ambiguous alternative;
		e.g. many cities are named San Jose and Georgetown, so
		prefer `Costa_Rica' to `San_Jose' and `Guyana' to `Georgetown'.
	Keep locations compact.  Use cities or small islands, not countries
		or regions, so that any future time zone changes do not split
		locations into different time zones.  E.g. prefer `Paris'
		to `France', since France has had multiple time zones.
	Use mainstream English spelling, e.g. prefer `Rome' to `Roma', and
		prefer `Athens' to the true name (which uses Greek letters).
		The POSIX file name restrictions encourage this rule.
	Use the most populous among locations in a country's time zone,
		e.g. prefer `Shanghai' to `Beijing'.  Among locations with
		similar populations, pick the best-known location,
		e.g. prefer `Rome' to `Milan'.
	Use the singular form, e.g. prefer `Canary' to `Canaries'.
	Omit common suffixes like `_Islands' and `_City', unless that
		would lead to ambiguity.  E.g. prefer `Cayman' to
		`Cayman_Islands' and `Guatemala' to `Guatemala_City',
		but prefer `Mexico_City' to `Mexico' because the country
		of Mexico has several time zones.
	Use `_' to represent a space.
	Omit `.' from abbreviations in names, e.g. prefer `St_Helena'
		to `St._Helena'.
	Do not change established names if they only marginally
		violate the above rules.  For example, don't change
		the existing name `Rome' to `Milan' merely because
		Milan's population has grown to be somewhat greater
		than Rome's.
	If a name is changed, put its old spelling in the `backward' file.

The file `zone.tab' lists the geographical locations used to name
time zone rule files.  It is intended to be an exhaustive list
of canonical names for geographic regions.

Older versions of this package used a different naming scheme,
and these older names are still supported.
See the file `backward' for most of these older names
(e.g. `US/Eastern' instead of `America/New_York').
The other old-fashioned names still supported are
`WET', `CET', `MET', `EET' (see the file `europe'),
and `Factory' (see the file `factory').


----- Time zone abbreviations -----

When this package is installed, it generates time zone abbreviations
like `EST' to be compatible with human tradition and POSIX.
Here are the general rules used for choosing time zone abbreviations,
in decreasing order of importance:

	Use abbreviations that consist of three or more ASCII letters.
		Previous editions of this database also used characters like
		' ' and '?', but these characters have a special meaning to
		the shell and cause commands like
			set `date`
		to have unexpected effects.
		Previous editions of this rule required upper-case letters,
		but the Congressman who introduced Chamorro Standard Time
		preferred "ChST", so the rule has been relaxed.

		This rule guarantees that all abbreviations could have
		been specified by a POSIX TZ string.  POSIX
		requires at least three characters for an
		abbreviation.  POSIX through 2000 says that an abbreviation
		cannot start with ':', and cannot contain ',', '-',
		'+', NUL, or a digit.  POSIX from 2001 on changes this
		rule to say that an abbreviation can contain only '-', '+',
		and alphanumeric characters from the portable character set
		in the current locale.  To be portable to both sets of
		rules, an abbreviation must therefore use only ASCII
		letters.

	Use abbreviations that are in common use among English-speakers,
		e.g. `EST' for Eastern Standard Time in North America.
		We assume that applications translate them to other languages
		as part of the normal localization process; for example,
		a French application might translate `EST' to `HNE'.

	For zones whose times are taken from a city's longitude, use the
		traditional xMT notation, e.g. `PMT' for Paris Mean Time.
		The only name like this in current use is `GMT'.

	If there is no common English abbreviation, abbreviate the English
		translation of the usual phrase used by native speakers.
		If this is not available or is a phrase mentioning the country
		(e.g. ``Cape Verde Time''), then:

		When a country has a single or principal time zone region,
			append `T' to the country's ISO	code, e.g. `CVT' for
			Cape Verde Time.  For summer time append `ST';
			for double summer time append `DST'; etc.
		When a country has multiple time zones, take the first three
			letters of an English place name identifying each zone
			and then append `T', `ST', etc. as before;
			e.g. `VLAST' for VLAdivostok Summer Time.

	Use UTC (with time zone abbreviation "zzz") for locations while
		uninhabited.  The "zzz" mnemonic is that these locations are,
		in some sense, asleep.

Application writers should note that these abbreviations are ambiguous
in practice: e.g. `EST' has a different meaning in Australia than
it does in the United States.  In new applications, it's often better
to use numeric UTC offsets like `-0500' instead of time zone
abbreviations like `EST'; this avoids the ambiguity.


----- Calendrical issues -----

Calendrical issues are a bit out of scope for a time zone database,
but they indicate the sort of problems that we would run into if we
extended the time zone database further into the past.  An excellent
resource in this area is Nachum Dershowitz and Edward M. Reingold,
<a href="http://emr.cs.iit.edu/home/reingold/calendar-book/third-edition/">
Calendrical Calculations: Third Edition
</a>, Cambridge University Press (2008).  Other information and
sources are given below.  They sometimes disagree.


France

Gregorian calendar adopted 1582-12-20.
French Revolutionary calendar used 1793-11-24 through 1805-12-31,
and (in Paris only) 1871-05-06 through 1871-05-23.


Russia

From Chris Carrier (1996-12-02):
On 1929-10-01 the Soviet Union instituted an ``Eternal Calendar''
with 30-day months plus 5 holidays, with a 5-day week.
On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
reverted to the 7-day week.  With the 6-day week the usual days
off were the 6th, 12th, 18th, 24th and 30th of the month.
(Source: Evitiar Zerubavel, _The Seven Day Circle_)


Mark Brader reported a similar story in "The Book of Calendars", edited
by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377.  But:

From: Petteri Sulonen (via Usenet)
Date: 14 Jan 1999 00:00:00 GMT
...

If your source is correct, how come documents between 1929 -- 1940 were
still dated using the conventional, Gregorian calendar?

I can post a scan of a document dated December 1, 1934, signed by
Yenukidze, the secretary, on behalf of Kalinin, the President of the
Executive Committee of the Supreme Soviet, if you like.



Sweden (and Finland)

From: Mark Brader
<a href="news:1996Jul6.012937.29190@@sq.com">
Subject: Re: Gregorian reform -- a part of locale?
</a>
Date: 1996-07-06

In 1700, Denmark made the transition from Julian to Gregorian.  Sweden
decided to *start* a transition in 1700 as well, but rather than have one of
those unsightly calendar gaps :-), they simply decreed that the next leap
year after 1696 would be in 1744 -- putting the whole country on a calendar
different from both Julian and Gregorian for a period of 40 years.

However, in 1704 something went wrong and the plan was not carried through;
they did, after all, have a leap year that year.  And one in 1708.  In 1712
they gave it up and went back to Julian, putting 30 days in February that
year!...

Then in 1753, Sweden made the transition to Gregorian in the usual manner,
getting there only 13 years behind the original schedule.

(A previous posting of this story was challenged, and Swedish readers
produced the following references to support it: "Tiderakning och historia"
by Natanael Beckman (1924) and "Tid, en bok om tiderakning och
kalendervasen" by Lars-Olof Lode'n (no date was given).)


Grotefend's data

From: "Michael Palmer" [with one obvious typo fixed]
Subject: Re: Gregorian Calendar (was Re: Another FHC related question
Newsgroups: soc.genealogy.german
Date: Tue, 9 Feb 1999 02:32:48 -800
...

The following is a(n incomplete) listing, arranged chronologically, of
European states, with the date they converted from the Julian to the
Gregorian calendar:

04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
                 Catholics and Danzig only)
09/20 Dec 1582 - France, Lorraine

21 Dec 1582/
   01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
10/21 Feb 1583 - bishopric of Liege (L"uttich)
13/24 Feb 1583 - bishopric of Augsburg
04/15 Oct 1583 - electorate of Trier
05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
                 Salzburg, Brixen
13/24 Oct 1583 - Austrian Oberelsass and Breisgau
20/31 Oct 1583 - bishopric of Basel
02/13 Nov 1583 - duchy of J"ulich-Berg
02/13 Nov 1583 - electorate and city of K"oln
04/15 Nov 1583 - bishopric of W"urzburg
11/22 Nov 1583 - electorate of Mainz
16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
17/28 Nov 1583 - bishopric of M"unster and duchy of Cleve
14/25 Dec 1583 - Steiermark

06/17 Jan 1584 - Austria and Bohemia
11/22 Jan 1584 - Luzern, Uri, Schwyz, Zug, Freiburg, Solothurn
12/23 Jan 1584 - Silesia and the Lausitz
22 Jan/
   02 Feb 1584 - Hungary (legally on 21 Oct 1587)
      Jun 1584 - Unterwalden
01/12 Jul 1584 - duchy of Westfalen

16/27 Jun 1585 - bishopric of Paderborn

14/25 Dec 1590 - Transylvania

22 Aug/
   02 Sep 1612 - duchy of Prussia

13/24 Dec 1614 - Pfalz-Neuburg

          1617 - duchy of Kurland (reverted to the Julian calendar in
                 1796)

          1624 - bishopric of Osnabr"uck

          1630 - bishopric of Minden

15/26 Mar 1631 - bishopric of Hildesheim

          1655 - Kanton Wallis

05/16 Feb 1682 - city of Strassburg

18 Feb/
   01 Mar 1700 - Protestant Germany (including Swedish possessions in
                 Germany), Denmark, Norway
30 Jun/
   12 Jul 1700 - Gelderland, Zutphen
10 Nov/
   12 Dec 1700 - Utrecht, Overijssel

31 Dec 1700/
   12 Jan 1701 - Friesland, Groningen, Z"urich, Bern, Basel, Geneva,
                 Turgau, and Schaffhausen

          1724 - Glarus, Appenzell, and the city of St. Gallen

01 Jan 1750    - Pisa and Florence

02/14 Sep 1752 - Great Britain

17 Feb/
   01 Mar 1753 - Sweden

1760-1812      - Graub"unden

The Russian empire (including Finland and the Baltic states) did not
convert to the Gregorian calendar until the Soviet revolution of 1917.

Source:  H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
(Hannover:  Hahnsche Buchhandlung, 1941), pp. 26-28.


----- Time and time zones on Mars -----

Some people have adjusted their work schedules to fit Mars time.
Dozens of special Mars watches were built for Jet Propulsion
Laboratory workers who kept Mars time during the Mars Exploration
Rovers mission (2004).  These timepieces look like normal Seikos and
Citizens but use Mars seconds rather than terrestrial seconds.

A Mars solar day is called a "sol" and has a mean period equal to
about 24 hours 39 minutes 35.244 seconds in terrestrial time.  It is
divided into a conventional 24-hour clock, so each Mars second equals
about 1.02749125 terrestrial seconds.

The prime meridian of Mars goes through the center of the crater
Airy-0, named in honor of the British astronomer who built the
Greenwich telescope that defines Earth's prime meridian.  Mean solar
time on the Mars prime meridian is called Mars Coordinated Time (MTC).

Each landed mission on Mars has adopted a different reference for
solar time keeping, so there is no real standard for Mars time zones.
For example, the Mars Exploration Rover project (2004) defined two
time zones "Local Solar Time A" and "Local Solar Time B" for its two
missions, each zone designed so that its time equals local true solar
time at approximately the middle of the nominal mission.  Such a "time
zone" is not particularly suited for any application other than the
mission itself.

Many calendars have been proposed for Mars, but none have achieved
wide acceptance.  Astronomers often use Mars Sol Date (MSD) which is a
sequential count of Mars solar days elapsed since about 1873-12-29
12:00 GMT.

The tz database does not currently support Mars time, but it is
documented here in the hopes that support will be added eventually.

Sources:

Michael Allison and Robert Schmunk,
"Technical Notes on Mars Solar Time as Adopted by the Mars24 Sunclock"
<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-07-30).

Jia-Rui Chong, "Workdays Fit for a Martian", Los Angeles Times
(2004-01-14), pp A1, A20-A21.
@


1.4
log
@SVN rev 200832 on 2009-12-22 11:17:10Z by edwin

MFV of tzdata2009t, r200831

zic:
- Fix URL / reference to Calendrical Calculations: Third Edition

libc/stdtime:
- Fix typo in tzfile.5 (no changes in our part)

MFC after:	1 week
@
text
@d4 1
a4 1
$FreeBSD$
@


1.3
log
@SVN rev 192890 on 2009-05-27 12:18:39Z by edwin

MFV of tzcode2009h revision r192887

- Clarify the license for the tzcode: public domain

MFC after:	1 month
@
text
@d1 1
a1 1
@@(#)Theory	8.3
d364 4
a367 4
resource in this area is Edward M. Reingold and Nachum Dershowitz,
<a href="http://emr.cs.uiuc.edu/home/reingold/calendar-book/second-edition/">
Calendrical Calculations: The Millennium Edition
</a>, Cambridge University Press (2001).  Other information and
@


1.3.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.3.2.2
log
@SVN rev 201183 on 2009-12-29 10:05:20Z by edwin

MFC of r200832, tzdata2009t

zic:
- Fix URL / reference to Calendrical Calculations: Third Edition

libc/stdtime:
- Fix typo in tzfile.5 (no changes in our part)
@
text
@d1 1
a1 1
@@(#)Theory	8.4
d364 4
a367 4
resource in this area is Nachum Dershowitz and Edward M. Reingold,
<a href="http://emr.cs.iit.edu/home/reingold/calendar-book/third-edition/">
Calendrical Calculations: Third Edition
</a>, Cambridge University Press (2008).  Other information and
@


1.3.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d4 1
a4 1
$FreeBSD: stable/8/usr.sbin/zic/Theory 201183 2009-12-29 10:05:20Z edwin $
@


1.3.2.2.6.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.3.2.2.6.2
log
@Switch importer
@
text
@d4 1
a4 1
$FreeBSD: releng/8.3/usr.sbin/zic/Theory 201183 2009-12-29 10:05:20Z edwin $
@


1.3.2.2.4.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.3.2.2.2.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.3.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.2
log
@SVN rev 192625 on 2009-05-23 06:31:50Z by edwin

MFV of tzcode2009e:

Upgrade of the tzcode from 2004a to 2009e.

Changes are numerous, but include...

- New format of the output of zic, which supports both 32 and 64
  bit time_t formats.

- zdump on 64 bit platforms will actually produce some output instead
  of doing nothing for a looooooooong time.

- linux_base-fX, with X >= at least 8, will work without problems related
  to the local time again.

The original patch, based on the 2008e, has been running for a long
time on both my laptop and desktop machine and have been tested by
other people.

After the installation of this code and the running of zic(8), you
need to run tzsetup(8) again to install the new datafile.

Approved by:	wollman@@ for usr.sbin/zic
MFC after:	1 month
@
text
@d1 3
a3 1
@@(#)Theory	8.2
a13 1

@


1.1
log
@Initial revision
@
text
@d1 2
a2 1
@@(#)Theory	7.2
d4 29
a32 12
These time and date functions are much like the System V Release 2.0 (SVR2)
time and date functions; there are a few additions and changes to extend
the usefulness of the SVR2 functions:

*	In SVR2, time display in a process is controlled by the environment
	variable TZ, which "must be a three-letter time zone name, followed
	by a number representing the difference between local time and
	Greenwich Mean Time in hours, followed by an optional three-letter
	name for a daylight time zone;" when the optional daylight time zone is
	present, "standard U.S.A. Daylight Savings Time conversion is applied."
	This means that SVR2 can't deal with other (for example, Australian)
	daylight savings time rules, or situations where more than two
d35 49
a83 2
*	In SVR2, time conversion information is compiled into each program
	that does time conversion.  This means that when time conversion
d87 1
a87 4
*	In SVR2, time conversion fails for near-minimum or near-maximum
	time_t values when doing conversions for places that don't use GMT.

*	In SVR2, there's no tamper-proof way for a process to learn the
d91 1
a91 1
	variable.  While an administrator can "do everything in GMT" to get
d93 1
a93 1
	daylight savings time shifts--as might be required to limit phone
d96 1
a96 2
*	These functions can account for leap seconds, thanks to Bradley White
	(bww@@k.cs.cmu.edu).
d98 1
a98 1
These are the changes that have been made to the SVR2 functions:
d111 1
a111 1
	take on values such as "US/Eastern" might cause "old" programs
d126 1
a126 1
	abbreviation to be used.  This differs from SVR2, where the elements
d131 1
a131 2
	needed or supported.  (You can use a compile-time option to cause
	these variables to be defined and to be set by "tzset"; however, their
d142 2
a143 2
	"tzsetwall();" if such code is moved to "old" systems that don't provide
	tzsetwall, you won't be able to generate an executable program.
d149 1
a149 1
Points of interest to folks with Version 7 or BSD systems:
d151 12
a162 1
*	The BSD "timezone" function is not present in this package;
d168 6
a173 2
	zone abbreviation to use.  Alternatively, use localtime(&clock)->tm_zone
	if this has been enabled.
d175 8
a182 11
*	The BSD gettimeofday function is not used in this package;
	this lets users control the time zone used in doing time conversions.
	Users who don't try to control things (that is, users who do not set
	the environment variable TZ) get the time conversion specified in the
	file "/etc/zoneinfo/localtime"; see the time zone compiler writeup for
	information on how to initialize this file.

The functions that are conditionally compiled if STD_INSPIRED is defined should,
at this point, be looked on primarily as food for thought.  They are not in
any sense "standard compatible"--some are not, in fact, specified in *any*
standard.  They do, however, represent responses of various authors to
d190 380
a569 3
close to SVR2 (with the exceptions outlined above) to ensure its broad
acceptability.  If more powerful time conversion functions can be standardized,
so much the better.
@


1.1.1.1
log
@The latest and greatest timezone code from Arthur David Olson, part 1.
This import comprises the `zic' and `zdump' programs.

Obtained from: Arthur David Olson, ftp://elsie.nci.nih.gov/pub/tzcode94g
@
text
@@


1.1.1.2
log
@Second part of the timezone code import for version 96h.  This includes
a number of bug fixes to the compiler (which bugs would previously
have caused undesirable behavior during transition times).
@
text
@d1 1
a1 1
@@(#)Theory	7.4
d50 1
a50 1
	take on values such as "America/New_York" might cause "old" programs
d82 2
a83 2
	"tzsetwall();" if such code is moved to "old" systems that don't
	provide tzsetwall, you won't be able to generate an executable program.
d97 2
a98 2
	zone abbreviation to use.  Alternatively, use
	localtime(&clock)->tm_zone if this has been enabled.
d107 4
a110 4
The functions that are conditionally compiled if STD_INSPIRED is defined
should, at this point, be looked on primarily as food for thought.  They are
not in any sense "standard compatible"--some are not, in fact, specified in
*any* standard.  They do, however, represent responses of various authors to
@


1.1.1.3
log
@Updated timezone compiler from Arthur Olson.

Obtained from: ftp://elsie.nci.nih.gov/pub/tzcode1999a.tar.gz
@
text
@d1 1
a1 1
@@(#)Theory	7.6
d3 12
a14 27

----- Outline -----

	Time and date functions
	Names of time zone regions
	Time zone abbreviations


----- Time and date functions -----

These time and date functions are upwards compatible with POSIX.1,
an international standard for Unix-like systems.
As of this writing, the current edition of POSIX.1 is:

  Information technology --Portable Operating System Interface (POSIX (R))
  -- Part 1: System Application Program Interface (API) [C Language]
  ISO/IEC 9945-1:1996
  ANSI/IEEE Std 1003.1, 1996 Edition
  1996-07-12

POSIX.1 has the following properties and limitations.

*	In POSIX.1, time display in a process is controlled by the
	environment variable TZ.  Unfortunately, the POSIX.1 TZ string takes
	a form that is hard to describe and is error-prone in practice.
	Also, POSIX.1 TZ strings can't deal with other (for example, Israeli)
	daylight saving time rules, or situations where more than two
d17 2
a18 35
	The POSIX.1 TZ string takes the following form:

		stdoffset[dst[offset],date[/time],date[/time]]

	where:
	
	std and dst
		are 3 or more characters specifying the standard
		and daylight saving time (DST) zone names.
	offset
		is of the form `[-]hh:[mm[:ss]]' and specifies the
		offset west of UTC.  The default DST offset is one hour
		ahead of standard time.
	date[/time],date[/time]
		specifies the beginning and end of DST.  If this is absent,
		the system supplies its own rules for DST, and these can
		differ from year to year; typically US DST rules are used.
	time
		takes the form `hh:[mm[:ss]]' and defaults to 02:00.
	date
		takes one of the following forms:
		Jn (1<=n<=365)
			origin-1 day number not counting February 29
		n (0<=n<=365)
			origin-0 day number counting February 29 if present
		Mm.n.d (0[Sunday]<=d<=6[Saturday], 1<=n<=5, 1<=m<=12)
			for the dth day of week n of month m of the year,
			where week 1 is the first week in which day d appears,
			and `5' stands for the last week in which day d appears
			(which may be either the 4th or 5th week).

*	In POSIX.1, when a TZ value like "EST5EDT" is parsed,
	typically the current US DST rules are used,
	but this means that the US DST rules are compiled into each program
	that does time conversion.  This means that when US time conversion
d22 4
a25 1
*	In POSIX.1, there's no tamper-proof way for a process to learn the
d29 1
a29 1
	variable.  While an administrator can "do everything in UTC" to get
d31 1
a31 1
	daylight saving time shifts--as might be required to limit phone
d34 2
a35 1
*	POSIX.1 requires that systems ignore leap seconds.
d37 1
a37 1
These are the extensions that have been made to the POSIX.1 functions:
d65 1
a65 1
	abbreviation to be used.  This differs from POSIX.1, where the elements
d70 2
a71 1
	needed.  (These variables are defined and set by "tzset"; however, their
d89 1
a89 13
*	These functions can account for leap seconds, thanks to Bradley White
	(bww@@k.cs.cmu.edu).

Points of interest to folks with other systems:

*	This package is already part of many POSIX-compliant hosts,
	including BSD, HP, Linux, Network Appliance, SCO, SGI, and Sun.
	On such hosts, the primary use of this package
	is to update obsolete time zone rule tables.
	To do this, you may need to compile the time zone compiler
	`zic' supplied with this package instead of using the system `zic',
	since the format of zic's input changed slightly in late 1994,
	and many vendors still do not support the new input format.
d91 1
a91 1
*	The Unix Version 7 "timezone" function is not present in this package;
d100 6
a105 7
*	The 4.2BSD gettimeofday function is not used in this package.
	This formerly let users obtain the current UTC offset and DST flag,
	but this functionality was removed in later versions of BSD.

*	In SVR2, time conversion fails for near-minimum or near-maximum
	time_t values when doing conversions for places that don't use UTC.
	This package takes care to do these conversions correctly.
d118 1
a118 1
contain valid extensions to POSIX.1, to ensure its broad
a120 109


----- Names of time zone rule files -----

The names of this package's installed time zone rule files are chosen to
help minimize possible future incompatibilities due to political events.
Ordinarily, names of countries are not used, to avoid incompatibilities
when countries change their name (e.g. Zaire->Congo) or
when locations change countries (e.g. Hong Kong from UK colony to China).

Names normally have the form AREA/LOCATION, where AREA is the name
of a continent or ocean, and LOCATION is the name of a specific
location within that region.  North and South America share the same
area, `America'.  Typical names are `Africa/Cairo', `America/New_York',
and `Pacific/Honolulu'.

Here are the general rules used for choosing location names,
in decreasing order of importance:

	Use only valid Posix file names.  Use only Ascii letters, digits, `.',
		`-' and `_'.  Do not exceed 14 characters or start with `-'.
		E.g. prefer `Brunei' to `Bandar_Seri_Begawan'.
	Include at least one location per time zone rule set per country.
		One such location is enough.
	If all the clocks in a country's region have agreed since 1970,
		don't bother to include more than one location
		even if subregions' clocks disagreed before 1970.
		Otherwise these tables would become annoyingly large.
	If a name is ambiguous, use a less ambiguous alternative;
		e.g. many cities are named San Jose and Georgetown, so
		prefer `Costa_Rica' to `San_Jose' and `Guyana' to `Georgetown'.
	Keep locations compact.  Use cities or small islands, not countries
		or regions, so that any future time zone changes do not split
		locations into different time zones.  E.g. prefer `Paris'
		to `France', since France has had multiple time zones.
	Use traditional English spelling, e.g. prefer `Rome' to `Roma', and
		prefer `Athens' to the true name (which uses Greek letters).
		The Posix file name restrictions encourage this rule.
	Use the most populous among locations in a country's time zone,
		e.g. prefer `Shanghai' to `Beijing'.  Among locations with
		similar populations, pick the best-known location,
		e.g. prefer `Rome' to `Milan'.
	Use the singular form, e.g. prefer `Canary' to `Canaries'.
	Omit common suffixes like `_Islands' and `_City', unless that
		would lead to ambiguity.  E.g. prefer `Cayman' to
		`Cayman_Islands' and `Guatemala' to `Guatemala_City',
		but prefer `Mexico_City' to `Mexico' because the country
		of Mexico has several time zones.
	Use `_' to represent a space.
	Omit `.' from abbreviations in names, e.g. prefer `St_Helena'
		to `St._Helena'.

The file `zone.tab' lists the geographical locations used to name
time zone rule files.

Older versions of this package used a different naming scheme,
and these older names are still supported.
See the file `backwards' for most of these older names
(e.g. `US/Eastern' instead of `America/New_York').
The other old-fashioned names still supported are
`WET', `CET', `MET', `EET' (see the file `europe'),
and `Factory' (see the file `factory').


----- Time zone abbreviations -----

When this package is installed, it generates time zone abbreviations
like `EST' to be compatible with human tradition and POSIX.1.
Here are the general rules used for choosing time zone abbreviations,
in decreasing order of importance:

	Use abbreviations that consist of 3 or more upper-case Ascii letters,
		except use "___" for locations while uninhabited.
		Posix.1 requires at least 3 characters, and the restriction to
		upper-case Ascii letters follows most traditions.
		Previous editions of this database also used characters like
		' ' and '?', but these characters have a special meaning to
		the shell and cause commands like
			set `date`
		to have unexpected effects.  In theory, the character set could
		be !%./@@A-Z^_a-z{}, but these tables use only upper-case
		Ascii letters (and "___").
	Use abbreviations that are in common use among English-speakers,
		e.g. `EST' for Eastern Standard Time in North America.
		We assume that applications translate them to other languages
		as part of the normal localization process; for example,
		a French application might translate `EST' to `HNE'.
	For zones whose times are taken from a city's longitude, use the
		traditional xMT notation, e.g. `PMT' for Paris Mean Time.
		The only name like this in current use is `GMT'.
	If there is no common English abbreviation, abbreviate the English
		translation of the usual phrase used by native speakers.
		If this is not available or is a phrase mentioning the country
		(e.g. ``Cape Verde Time''), then:

		When a country has a single or principal time zone region,
			append `T' to the country's ISO	code, e.g. `CVT' for
			Cape Verde Time.  For summer time append `ST';
			for double summer time append `DST'; etc.
		When a country has multiple time zones, take the first three
			letters of an English place name identifying each zone
			and then append `T', `ST', etc. as before;
			e.g. `VLAST' for VLAdivostok Summer Time.

Application writers should note that these abbreviations are ambiguous
in practice: e.g. `EST' has a different meaning in Australia than
it does in the United States.  In new applications, it's often better
to use numeric UTC offsets like `-0500' instead of time zone
abbreviations like `EST'; this avoids the ambiguity.
@


1.1.1.4
log
@Import the rest of tzcode2004a, the bits needed for the timezone compiler.

Obtained from:	ftp://elsie.nci.nih.gov/pub/tzcode2004a.tar.gz
@
text
@d1 1
a1 1
@@(#)Theory	7.15
a8 2
	Calendrical issues
	Time and time zones on Mars
d14 1
a14 1
an international standard for UNIX-like systems.
d37 1
a37 1

d146 1
a146 1
*	The UNIX Version 7 "timezone" function is not present in this package;
d181 5
a185 28
The time zone rule file naming conventions attempt to strike a balance
among the following goals:

 * Uniquely identify every national region where clocks have all
   agreed since 1970.  This is essential for the intended use: static
   clocks keeping local civil time.

 * Indicate to humans as to where that region is.  This simplifes use.

 * Be robust in the presence of political changes.  This reduces the
   number of updates and backward-compatibility hacks.  For example,
   names of countries are ordinarily not used, to avoid
   incompatibilities when countries change their name
   (e.g. Zaire->Congo) or when locations change countries
   (e.g. Hong Kong from UK colony to China).

 * Be portable to a wide variety of implementations.
   This promotes use of the technology.

 * Use a consistent naming convention over the entire world.
   This simplifies both use and maintenance.

This naming convention is not intended for use by inexperienced users
to select TZ values by themselves (though they can of course examine
and reuse existing settings).  Distributors should provide
documentation and/or a simple selection interface that explains the
names; see the 'tzselect' program supplied with this distribution for
one example.
d196 3
a198 7
	Use only valid POSIX file name components (i.e., the parts of
		names other than `/').  Within a file name component,
		use only ASCII letters, `.', `-' and `_'.  Do not use
		digits, as that might create an ambiguity with POSIX
		TZ strings.  A file name component must not exceed 14
		characters or start with `-'.  E.g., prefer `Brunei'
		to `Bandar_Seri_Begawan'.
d200 1
a200 2
		One such location is enough.  Use ISO 3166 (see the file
		iso3166.tab) to help decide whether something is a country.
d212 1
a212 1
	Use mainstream English spelling, e.g. prefer `Rome' to `Roma', and
d214 1
a214 1
		The POSIX file name restrictions encourage this rule.
a227 6
	Do not change established names if they only marginally
		violate the above rules.  For example, don't change
		the existing name `Rome' to `Milan' merely because
		Milan's population has grown to be somewhat greater
		than Rome's.
	If a name is changed, put its old spelling in the `backward' file.
d234 1
a234 1
See the file `backward' for most of these older names
d248 4
a251 1
	Use abbreviations that consist of three or more ASCII letters.
d256 3
a258 18
		to have unexpected effects.
		Previous editions of this rule required upper-case letters,
		but the Congressman who introduced Chamorro Standard Time
		preferred "ChST", so the rule has been relaxed.

		This rule guarantees that all abbreviations could have
		been specified by a POSIX.1 TZ string.  POSIX.1
		requires at least three characters for an
		abbreviation.  POSIX.1-1996 says that an abbreviation
		cannot start with ':', and cannot contain ',', '-',
		'+', NUL, or a digit.  Draft 7 of POSIX 1003.1-200x
		changes this rule to say that an abbreviation can
		contain only '-', '+', and alphanumeric characters in
		the current locale.  To be portable to both sets of
		rules, an abbreviation must therefore use only ASCII
		letters, as these are the only letters that are
		alphabetic in all locales.

a263 1

a266 1

a280 3
	Use "zzz" for locations while uninhabited.  The mnemonic is that
		these locations are, in some sense, asleep.

a285 214


----- Calendrical issues -----

Calendrical issues are a bit out of scope for a time zone database,
but they indicate the sort of problems that we would run into if we
extended the time zone database further into the past.  An excellent
resource in this area is Nachum Dershowitz and Edward M. Reingold,
<a href="http://emr.cs.uiuc.edu/home/reingold/calendar-book/index.shtml">
Calendrical Calculations
</a>, Cambridge University Press (1997).  Other information and
sources are given below.  They sometimes disagree.


France

Gregorian calendar adopted 1582-12-20.
French Revolutionary calendar used 1793-11-24 through 1805-12-31,
and (in Paris only) 1871-05-06 through 1871-05-23.


Russia

From Chris Carrier <72157.3334@@CompuServe.COM> (1996-12-02):
On 1929-10-01 the Soviet Union instituted an ``Eternal Calendar''
with 30-day months plus 5 holidays, with a 5-day week.
On 1931-12-01 it changed to a 6-day week; in 1934 it reverted to the
Gregorian calendar while retaining the 6-day week; on 1940-06-27 it
reverted to the 7-day week.  With the 6-day week the usual days
off were the 6th, 12th, 18th, 24th and 30th of the month.
(Source: Evitiar Zerubavel, _The Seven Day Circle_)


Mark Brader reported a similar story in "The Book of Calendars", edited
by Frank Parise (1982, Facts on File, ISBN 0-8719-6467-8), page 377.  But:

From: Petteri Sulonen (via Usenet)
Date: 14 Jan 1999 00:00:00 GMT
Message-ID: <Petteri.Sulonen-1401991626030001@@lapin-kulta.in.helsinki.fi>

If your source is correct, how come documents between 1929 -- 1940 were
still dated using the conventional, Gregorian calendar?

I can post a scan of a document dated December 1, 1934, signed by
Yenukidze, the secretary, on behalf of Kalinin, the President of the
Executive Committee of the Supreme Soviet, if you like.



Sweden (and Finland)

From: msb@@sq.com (Mark Brader)
<a href="news:1996Jul6.012937.29190@@sq.com">
Subject: Re: Gregorian reform -- a part of locale?
</a>
Date: 1996-07-06

In 1700, Denmark made the transition from Julian to Gregorian.  Sweden
decided to *start* a transition in 1700 as well, but rather than have one of
those unsightly calendar gaps :-), they simply decreed that the next leap
year after 1696 would be in 1744 -- putting the whole country on a calendar
different from both Julian and Gregorian for a period of 40 years.

However, in 1704 something went wrong and the plan was not carried through;
they did, after all, have a leap year that year.  And one in 1708.  In 1712
they gave it up and went back to Julian, putting 30 days in February that
year!...

Then in 1753, Sweden made the transition to Gregorian in the usual manner,
getting there only 13 years behind the original schedule.

(A previous posting of this story was challenged, and Swedish readers
produced the following references to support it: "Tiderakning och historia"
by Natanael Beckman (1924) and "Tid, en bok om tiderakning och
kalendervasen" by Lars-Olof Lode'n (no date was given).)


Grotefend's data

From: "Michael Palmer" <mpalmer@@netcom.com> [with one obvious typo fixed]
Subject: Re: Gregorian Calendar (was Re: Another FHC related question
Newsgroups: soc.genealogy.german
Date: Tue, 9 Feb 1999 02:32:48 -800
Message-ID: <199902091032.CAA09644@@netcom10.netcom.com>

The following is a(n incomplete) listing, arranged chronologically, of
European states, with the date they converted from the Julian to the
Gregorian calendar:

04/15 Oct 1582 - Italy (with exceptions), Spain, Portugal, Poland (Roman
                 Catholics and Danzig only)
09/20 Dec 1582 - France, Lorraine

21 Dec 1582/
   01 Jan 1583 - Holland, Brabant, Flanders, Hennegau
10/21 Feb 1583 - bishopric of Liege (L"uttich)
13/24 Feb 1583 - bishopric of Augsburg
04/15 Oct 1583 - electorate of Trier
05/16 Oct 1583 - Bavaria, bishoprics of Freising, Eichstedt, Regensburg,
                 Salzburg, Brixen
13/24 Oct 1583 - Austrian Oberelsass and Breisgau
20/31 Oct 1583 - bishopric of Basel
02/13 Nov 1583 - duchy of J"ulich-Berg
02/13 Nov 1583 - electorate and city of K"oln
04/15 Nov 1583 - bishopric of W"urzburg
11/22 Nov 1583 - electorate of Mainz
16/27 Nov 1583 - bishopric of Strassburg and the margraviate of Baden
17/28 Nov 1583 - bishopric of M"unster and duchy of Cleve
14/25 Dec 1583 - Steiermark

06/17 Jan 1584 - Austria and Bohemia
11/22 Jan 1584 - Luzern, Uri, Schwyz, Zug, Freiburg, Solothurn
12/23 Jan 1584 - Silesia and the Lausitz
22 Jan/
   02 Feb 1584 - Hungary (legally on 21 Oct 1587)
      Jun 1584 - Unterwalden
01/12 Jul 1584 - duchy of Westfalen

16/27 Jun 1585 - bishopric of Paderborn

14/25 Dec 1590 - Transylvania

22 Aug/
   02 Sep 1612 - duchy of Prussia

13/24 Dec 1614 - Pfalz-Neuburg

          1617 - duchy of Kurland (reverted to the Julian calendar in
                 1796)

          1624 - bishopric of Osnabr"uck

          1630 - bishopric of Minden

15/26 Mar 1631 - bishopric of Hildesheim

          1655 - Kanton Wallis

05/16 Feb 1682 - city of Strassburg

18 Feb/
   01 Mar 1700 - Protestant Germany (including Swedish possessions in
                 Germany), Denmark, Norway
30 Jun/
   12 Jul 1700 - Gelderland, Zutphen
10 Nov/
   12 Dec 1700 - Utrecht, Overijssel

31 Dec 1700/
   12 Jan 1701 - Friesland, Groningen, Z"urich, Bern, Basel, Geneva,
                 Turgau, and Schaffhausen

          1724 - Glarus, Appenzell, and the city of St. Gallen

01 Jan 1750    - Pisa and Florence

02/14 Sep 1752 - Great Britain

17 Feb/
   01 Mar 1753 - Sweden

1760-1812      - Graub"unden

The Russian empire (including Finland and the Baltic states) did not
convert to the Gregorian calendar until the Soviet revolution of 1917.

Source:  H. Grotefend, _Taschenbuch der Zeitrechnung des deutschen
Mittelalters und der Neuzeit_, herausgegeben von Dr. O. Grotefend
(Hannover:  Hahnsche Buchhandlung, 1941), pp. 26-28.


----- Time and time zones on Mars -----

Some people have adjusted their work schedules to fit Mars time.
Dozens of special Mars watches were built for Jet Propulsion
Laboratory workers who kept Mars time during the Mars Exploration
Rovers mission (2004).  These timepieces look like normal Seikos and
Citizens but use Mars seconds rather than terrestrial seconds.

A Mars solar day is called a "sol" and has a mean period equal to
about 24 hours 39 minutes 35.244 seconds in terrestrial time.  It is
divided into a conventional 24-hour clock, so each Mars second equals
about 1.02749125 terrestrial seconds.

The prime meridian of Mars goes through the center of the crater
Airy-0, named in honor of the British astronomer who built the
Greenwich telescope that defines Earth's prime meridian.  Mean solar
time on the Mars prime meridian is called Mars Coordinated Time (MTC).

Each landed mission on Mars has adopted a different reference for
solar time keeping, so there is no real standard for Mars time zones.
For example, the Mars Exploration Rover project (2004) defined two
time zones "Local Solar Time A" and "Local Solar Time B" for its two
missions, each zone designed so that its time equals local true solar
time at approximately the middle of the nominal mission.  Such a "time
zone" is not particularly suited for any application other than the
mission itself.

Many calendars have been proposed for Mars, but none have achieved
wide acceptance.  Astronomers often use Mars Sol Date (MSD) which is a
sequential count of Mars solar days elapsed since about 1873-12-29
12:00 GMT.

The tz database does not currently support Mars time, but it is
documented here in the hopes that support will be added eventually.

Sources:

Michael Allison and Robert Schmunk,
"Technical Notes on Mars Solar Time as Adopted by the Mars24 Sunclock"
<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-03-15).

Jia-Rui Chong, "Workdays Fit for a Martian", Los Angeles Times
(2004-01-14), pp A1, A20-A21.
@


1.1.1.4.18.1
log
@SVN rev 196683 on 2009-08-31 02:22:18Z by edwin

MFC of r192625, r192890, r194783, r196587:

r192625:
MFC of tzcode2009e:

Upgrade of the tzcode from 2004a to 2009e.

Changes are numerous, but include...

- New format of the output of zic, which supports both 32 and 64
  bit time_t formats.

- zdump on 64 bit platforms will actually produce some output instead
  of doing nothing for a looooooooong time.

- linux_base-fX, with X >= at least 8, will work without problems related
  to the local time again.

The original patch, based on the 2008e, has been running for a long
time on both my laptop and desktop machine and have been tested by
other people.

After the installation of this code and the running of zic(8), you
need to run tzsetup(8) again to install the new datafile.

r192890:

MFC of tzcode2009h

- Clarify the license for the tzcode: public domain

r194783:

Remove duplicate if-statement on gmt_is_set in gmtsub().

r196587:

MFC of tzcode2009k

zic.c:
    Do not end a binary file with a POSIX-style time zone string
    for locations that end up in permanent DST (thanks to Andreas
    Schwab).
@
text
@d1 2
a2 4
@@(#)Theory	8.3
This file is in the public domain, so clarified as of
2009-05-17 by Arthur David Olson.
$FreeBSD$
d12 1
d15 1
a15 1
These time and date functions are upwards compatible with POSIX,
d17 1
a17 1
As of this writing, the current edition of POSIX is:
d19 5
a23 6
  Standard for Information technology
  -- Portable Operating System Interface (POSIX (R))
  -- System Interfaces
  IEEE Std 1003.1, 2004 Edition
  <http://www.opengroup.org/online-pubs?DOC=7999959899>
  <http://www.opengroup.org/pubs/catalog/t041.htm>
d25 1
a25 1
POSIX has the following properties and limitations.
d27 2
a28 2
*	In POSIX, time display in a process is controlled by the
	environment variable TZ.  Unfortunately, the POSIX TZ string takes
d30 1
a30 1
	Also, POSIX TZ strings can't deal with other (for example, Israeli)
d34 1
a34 1
	The POSIX TZ string takes the following form:
a42 3
		Starting with POSIX.1-2001, std and dst may also be
		in a quoted form like "<UTC+10>"; this allows
		"+" and "-" in the names.
d65 2
a66 13
	Here is an example POSIX TZ string, for US Pacific time using rules
	appropriate from 1987 through 2006:

		TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'

	This POSIX TZ string is hard to remember, and mishandles time stamps
	before 1987 and after 2006.  With this package you can use this
	instead:

		TZ='America/Los_Angeles'

*	POSIX does not define the exact meaning of TZ values like "EST5EDT".
	Typically the current US DST rules are used to interpret such values,
d72 1
a72 1
*	In POSIX, there's no tamper-proof way for a process to learn the
d81 1
a81 1
*	POSIX requires that systems ignore leap seconds.
d83 1
a83 1
These are the extensions that have been made to the POSIX functions:
d111 1
a111 1
	abbreviation to be used.  This differs from POSIX, where the elements
d134 2
a135 1
*	These functions can account for leap seconds, thanks to Bradley White.
d176 3
a178 3
contain valid extensions to POSIX, to ensure its broad acceptability.  If
more powerful time conversion functions can be standardized, so much the
better.
a230 2
		However, uninhabited ISO 3166 regions like Bouvet Island
		do not need locations, since local time is not defined there.
d266 1
a266 2
time zone rule files.  It is intended to be an exhaustive list
of canonical names for geographic regions.
d280 1
a280 1
like `EST' to be compatible with human tradition and POSIX.
d295 1
a295 1
		been specified by a POSIX TZ string.  POSIX
d297 1
a297 1
		abbreviation.  POSIX through 2000 says that an abbreviation
d299 4
a302 4
		'+', NUL, or a digit.  POSIX from 2001 on changes this
		rule to say that an abbreviation can contain only '-', '+',
		and alphanumeric characters from the portable character set
		in the current locale.  To be portable to both sets of
d304 2
a305 1
		letters.
d331 2
a332 3
	Use UTC (with time zone abbreviation "zzz") for locations while
		uninhabited.  The "zzz" mnemonic is that these locations are,
		in some sense, asleep.
d346 4
a349 4
resource in this area is Edward M. Reingold and Nachum Dershowitz,
<a href="http://emr.cs.uiuc.edu/home/reingold/calendar-book/second-edition/">
Calendrical Calculations: The Millennium Edition
</a>, Cambridge University Press (2001).  Other information and
d362 1
a362 1
From Chris Carrier (1996-12-02):
d377 1
a377 1
...
d390 1
a390 1
From: Mark Brader
d418 1
a418 1
From: "Michael Palmer" [with one obvious typo fixed]
d422 1
a422 1
...
d549 1
a549 1
<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-07-30).
@


1.1.1.4.18.2
log
@SVN rev 201184 on 2009-12-29 10:05:43Z by edwin

MFC of r200832, tzdata2009t

zic:
- Fix URL / reference to Calendrical Calculations: Third Edition

libc/stdtime:
- Fix typo in tzfile.5 (no changes in our part)
@
text
@d1 1
a1 1
@@(#)Theory	8.4
d364 4
a367 4
resource in this area is Nachum Dershowitz and Edward M. Reingold,
<a href="http://emr.cs.iit.edu/home/reingold/calendar-book/third-edition/">
Calendrical Calculations: Third Edition
</a>, Cambridge University Press (2008).  Other information and
@


1.1.1.4.18.3
log
@Switch importer
@
text
@d4 1
a4 1
$FreeBSD: stable/7/usr.sbin/zic/Theory 201184 2009-12-29 10:05:43Z edwin $
@


1.1.1.4.18.2.4.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.1.1.4.18.2.4.2
log
@Switch importer
@
text
@d4 1
a4 1
$FreeBSD: releng/7.4/usr.sbin/zic/Theory 201184 2009-12-29 10:05:43Z edwin $
@


1.1.1.4.18.2.2.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


