Re: Solaris 2.7 Daylight saving time fix
Jonathan Leffler <[email protected]> Tue, 30 Jan 2007 19:12:22 -0800
| Newsgroups | gmane.comp.security.sun |
|---|---|
| Message-ID | <OFE9BCD223.5CE2936A-ON88257274.0011098D-88257274.00119CD6@us.ibm.com> |
Casper Dik <[email protected]> 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 ([email protected]) 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!"