Re: Solaris 2.7 Daylight saving time fix



Casper Dik <casper.dik@xxxxxxx> wrote:
The POSIX standard *requires* that the ?STx?DT format precludes
the use of zone files.

Any OS which uses the zoneinfo files is not compliant when the $TZ
variable can be parsed under the POSIX rules.

Please can you indicate chapter and verse in POSIX where it says that?

The specification that I can find (SUS3 at Open Group) leaves it
completely unspecified what rules might apply to the switch between winter
and summer (or standard and daylight saving) times. It shows how to set
the rule by including the information in the TZ variable, but it does not
state what the rule is in the absence of a specific setting.


Quoting some standard (Base Definitions, Environment Variables)


TZ
This variable shall represent timezone information. The contents of the
environment variable named TZ shall be used by the ctime(), localtime(),
strftime(), mktime(), ctime_r(), and localtime_r() functions, and by
various utilities, to override the default timezone. The value of TZ has
one of the two forms (spaces inserted for clarity):
:characters
or:
std offset dst offset, rule
If TZ is of the first format (that is, if the first character is a colon),
the characters following the colon are handled in an
implementation-defined manner.
The expanded format (for all TZ s whose value does not have a colon as the
first character) is as follows:
stdoffset[dst[offset][,start[/time],end[/time]]]
Where:
std and dst
Indicate no less than three, nor more than {TZNAME_MAX}, bytes that are
the designation for the standard ( std) or the alternative ( dst -such as
Daylight Savings Time) timezone. Only std is required; if dst is missing,
then the alternative time does not apply in this locale.
Each of these fields may occur in either of two formats quoted or
unquoted:
In the quoted form, the first character shall be the less-than ( '<' )
character and the last character shall be the greater-than ( '>' )
character. All characters between these quoting characters shall be
alphanumeric characters from the portable character set in the current
locale, the plus-sign ( '+' ) character, or the minus-sign ( '-' )
character. The std and dst fields in this case shall not include the
quoting characters.
In the unquoted form, all characters in these fields shall be alphabetic
characters from the portable character set in the current locale.
The interpretation of these fields is unspecified if either field is less
than three bytes (except for the case when dst is missing), more than
{TZNAME_MAX} bytes, or if they contain characters other than those
specified.
offset
Indicates the value added to the local time to arrive at Coordinated
Universal Time. The offset has the form:
hh[:mm[:ss]]
The minutes ( mm) and seconds ( ss) are optional. The hour ( hh) shall be
required and may be a single digit. The offset following std shall be
required. If no offset follows dst, the alternative time is assumed to be
one hour ahead of standard time. One or more digits may be used; the value
is always interpreted as a decimal number. The hour shall be between zero
and 24, and the minutes (and seconds)-if present-between zero and 59. The
result of using values outside of this range is unspecified. If preceded
by a '-', the timezone shall be east of the Prime Meridian; otherwise, it
shall be west (which may be indicated by an optional preceding '+' ).
rule
Indicates when to change to and back from the alternative time. The rule
has the form:
date[/time],date[/time]
where the first date describes when the change from standard to
alternative time occurs and the second date describes when the change back
happens. Each time field describes when, in current local time, the change
to the other time is made.
The format of date is one of the following:
Jn
The Julian day n (1 <= n <= 365). Leap days shall not be counted. That is,
in all years-including leap years-February 28 is day 59 and March 1 is day
60. It is impossible to refer explicitly to the occasional February 29.
n
The zero-based Julian day (0 <= n <= 365). Leap days shall be counted, and
it is possible to refer to February 29.
Mm.n.d
The d'th day (0 <= d <= 6) of week n of month m of the year (1 <= n <= 5,
1 <= m <= 12, where week 5 means "the last d day in month m" which may
occur in either the fourth or the fifth week). Week 1 is the first week in
which the d'th day occurs. Day zero is Sunday.
The time has the same format as offset except that no leading sign ( '-'
or '+' ) is allowed. The default, if time is not given, shall be 02:00:00.


--
Jonathan Leffler (jleffler@xxxxxxxxxx)
STSM, Informix Database Engineering, IBM Information Management Division
4100 Bohannon Drive, Menlo Park, CA 94025-1013
Tel: +1 650-926-6921 Tie-Line: 630-6921
"I don't suffer from insanity; I enjoy every minute of it!"



Relevant Pages

  • Re: Trying to parse/match a C string literal
    ... I re-ran the tests taking out any escaped characters ... Found floating substr "%"" at offset 2... ... trying floating at offset 3... ... whilem: ...
    (comp.lang.perl.misc)
  • Re: Date reformatting question
    ... form is submitted comes through in the following format ... which seems to me to be a General formatted cell ... I believe there is a way to take DST into account automagically by using a system function in VBA. ... But that assume that date is always 10 characters and the time is always 8 characters. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: newbie: j2me & isWhiteSpace
    ... > decent program fails to handle Unicode characters elegantly (lack of Unicode ... That's what j2me gives you, so you have to live with it, unless you seek ... * Grabs an attribute offset from the Unicode attribute database. ...
    (comp.lang.java.programmer)
  • Re: What does this do?
    ... a substring containing characters at offsets given by the range is ... In all three cases, if an offset is negative, it is counted from the end ... Open IRB, say "if this thing the docs are telling me is correct, and I ... Find the patterns in the output, make a hypothesis, see if it gives you what ...
    (comp.lang.ruby)
  • Re: recording the position of m// searches
    ... This brings us to 20 characters BEFORE the start of the match (regardless ... that defines how to use this offset. ... Once we're done finding matches on this line, we want to go back to where ... CPAN ID: PINYAN [Need a programmer? ...
    (perl.beginners)