More syntax reference.  I've done a quick survey of interpretations
of $TZ.  I'll also throw in a couple of formats not used in $TZ.

glibc tzset() interpretation of $TZ
-----------------------------------

Accepts a subset of POSIX format.  Does not document (but does support)
the option to omit the start and end dates when including a DST part.
Does not support <> quotation of abbreviations.  Accepts some strings
that don't precisely meet the POSIX standard.

Accepts ":" followed by a pathname, specifying a tzfile to read from.
If the filename does not begin with "/" then it is relative to the system
timezone directory (which usually has the Olson database).

Undocumented: a pathname may be given without a ":", and a POSIX format
with a leading ":".  It appears that the leading ":" is actually ignored.

If a $TZ string is not understood as either a POSIX spec or a pathname
then UT is used with the abbreviation being either blank or the $TZ string
(with leading ":" if any removed).

Olson tzset() interpretation of $TZ
-----------------------------------

Accepts a pathname, specifying a tzfile to read from, optionally preceded
by a ":".  If the filename does not begin with "/" then it is relative
to the system timezone directory (containing the Olson database).

Accepts POSIX format (no leading ":" permitted).

If a $TZ string is not understood as either a POSIX spec or a pathname
then UT is used with the abbreviation "GMT".

Solaris tzset() interpretation of $TZ
-------------------------------------

Accepts a pathname, specifying a tzfile to read from, optionally preceded
by a ":".  If the filename does not begin with "/" then it is relative
to the system timezone directory (containing the Olson database).

Accepts POSIX format (no leading ":" permitted).

If a $TZ string is not understood as either a POSIX spec or a pathname
then (not sure) either the system default timezone is used or UT is used
with the abbreviation "GMT".

HP-UX tzset() interpretation of $TZ
-----------------------------------

Accepts POSIX format, optionally preceded by ":".

Behaviour unknown if POSIX parsing fails.  (I don't have an HP-UX system
to test on, so I'm just going by the documentation.)

DateTime::TimeZone interpretation of "name" argument
----------------------------------------------------

Accepts Olson link names.  An all-uppercase link name may be given in
lower or mixed case.

"floating" refers to DateTime::TimeZone::Floating, which is not a real
timezone but is treated like one.

"UTC" or "Z" (the latter undocumented) refers to UT (the class
DateTime::TimeZone::UTC is used).

"local" indicates that the timezone is not specified here, and the
environment and system default should be examined instead.

Accepts fixed offsets from UT (using the class
DateTime::TimeZone::OffsetOnly) specified with strings matching
qr/[-+]?\d\d?:\d\d(:\d\d)?/.  Offsets must be less than 100 hours.

Accepts multi-part and a handful of single-part names of classes under
DateTime::TimeZone::, with "::" optionally represented as "/" and "_"
optionally represented as "-".  The single-part names accepted all
match qr/[A-Z]ST(\d[A-Z]DT)?/.  Multi-partness of names is judged by
the presence of a "/" character; anything using "::" only is rejected.
The restriction on single-part names is not documented.  The subclasses
available includes all the non-link multi-part names in the Olson
database.

Signals an error if the string is not understood in any of these ways.

DateTime::TimeZone interpretation of environment variables
----------------------------------------------------------

Rejects the empty string and anything containing characters other
than alphanumeric, "_", "-", "+", and "/".  Also rejects "local".
Anything else is passed on to the DT::TZ constructor as a "name" argument.

The practical effect of that is that all the values accepted by the
constructor are accepted except for "local", fixed offsets, and class
names specified using "::".  Of these rejections, only the "local"
one is documented.

If the string is rejected, or if DT::TZ->new() signals an error, the
system default timezone is used instead.

nautical timezone letters
-------------------------

A single capital letter, other than "J", is used to specify UT-based
timezones at one-hour intervals, from UT-12h to UT+12h inclusive.
"Z" represents UT, "A" UT+1h, "B" UT+2h, ..., "I" UT+9h, "K" UT+10h,
"L" UT+11h, "M" UT+12h, "N" UT-1h, "O" UT-2h, ..., "Y" UT-12h.

Interpretation of "UT" in the above paragraph is complicated.  Nautical
timekeeping has been precise enough to distinguish between UTC and UT1
for longer than UTC has existed.  Sub-second timekeeping is essential for
precise astronomical navigation.  These timezones were originally based
specifically on GMT (UT1).  The DUT1 correction is published in order
to allow nautical use of UTC, so modern practice probably does use UTC.

ISO 8601
--------

"Z" represents the base time scale.  An offset in hours and minutes may
be specified with the syntax qr/[-+]\d\d:\d\d/ (except that "-00:00"
is prohibited).

The standard mentions UTC in some places, but isn't actually specific to
that.  The textual formats are applicable to any use of the 24-hour clock.

-zefram

Reply via email to