AIX & HPUX C libraries report DST reversal in November 1974 (Pacific) - Aix

This is a discussion on AIX & HPUX C libraries report DST reversal in November 1974 (Pacific) - Aix ; The following program does not assert when compiled and run under AIX 5.2 and HP-UX B.11.23: #include #include static tm* mktm (int sec = 0 , int min = 0, int hour = 0, int mday = 1, int mon ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: AIX & HPUX C libraries report DST reversal in November 1974 (Pacific)

  1. AIX & HPUX C libraries report DST reversal in November 1974 (Pacific)

    The following program does not assert when compiled and run under AIX
    5.2 and HP-UX B.11.23:

    #include
    #include

    static tm*
    mktm (int sec = 0 , int min = 0, int hour = 0,
    int mday = 1, int mon = 0, int year = 0,
    int wday = 0, int yday = 0,int isdst = -1)
    {
    static tm tmp = tm ();

    // use arguments to initialize struct
    tmp.tm_sec = sec;
    tmp.tm_min = min;
    tmp.tm_hour = hour;
    tmp.tm_mday = mday;
    tmp.tm_mon = mon;
    tmp.tm_year = year;
    tmp.tm_wday = wday;
    tmp.tm_yday = yday;
    tmp.tm_isdst = isdst;

    return &tmp;
    }

    #undef T
    #define T mktm

    static void
    test (tm* t, bool isdst)
    {
    assert (0 < mktime (t));
    assert ((t->tm_isdst == 1) == isdst);
    }

    int
    main ()
    {

    // DST in effect at 2:00 AM on 6th of January, 1974?
    test (T (59, 59, 1, 6, 0, 74), false);
    test (T ( 0, 0, 3, 6, 0, 74), true);

    // DST ends at 3:00 AM on 24th of November, 1974?
    test (T (59, 59, 0, 24, 10, 74), true);
    test (T ( 0, 0, 3, 24, 10, 74), false);

    return 0;
    }

    For AIX:

    ~$ env | grep TZ
    TZ=PST8PDT
    ~$ xlC t.cpp && ./a.out
    ~$

    and the same for HP-UX:

    ~$ env | grep TZ

    TZ=PST8PDT
    ~$ aCC t.cpp && ./a.out
    ~$

    Basically it shows that the information for Pacific timezone has DST
    reverting on the 24th of November instead of the 27th of October (Linux
    reports the latter). The timezone database file for North America
    (http://www.twinsun.com/tz/tz-link.htm) says:

    # From Arthur David Olson:
    # US Daylight Saving Time ended on the last Sunday of *October* in
    1974.
    # See, for example, the front page of the Saturday, 1974-10-26
    # and Sunday, 1974-10-27 editions of the Washington Post.

    (AIX is not among the OSes listed as using that database.)

    Does anyone know if this is a bug? If so, is there a patch for this? Or
    maybe it is a matter of dispute?! Any insight is appreciated.

    Thanks.


  2. Re: AIX & HPUX C libraries report DST reversal in November 1974 (Pacific)

    nikkoara wrote:
    : The following program does not assert when compiled and run under AIX
    : 5.2 and HP-UX B.11.23:

    : // DST in effect at 2:00 AM on 6th of January, 1974?
    : // DST ends at 3:00 AM on 24th of November, 1974?
    : Basically it shows that the information for Pacific timezone has DST
    : reverting on the 24th of November instead of the 27th of October

    That's what /usr/lib/tztab has, Nov. In the last 20+ years, I've always
    assumed it was right. While I was around in 1974, I was mostly worried
    about lines at the gas stations, not when DST ended. ;-)

    I would have assumed that DST would have been extended on both ends.

    : The timezone database file for North America
    : (http://www.twinsun.com/tz/tz-link.htm) says:
    : # From Arthur David Olson:
    : # US Daylight Saving Time ended on the last Sunday of *October* in 1974.
    : # See, for example, the front page of the Saturday, 1974-10-26
    : # and Sunday, 1974-10-27 editions of the Washington Post.

    This google search says it was extended from 6 to 10 months in 1974 so
    that would be 3 at the start and one at the end:
    http://books.google.com/books?q=dst+...print&ct=title
    After the Arab Oil Embargo of 1973, an experiment in energy conservation was
    tried in 1974 and 1975. DST was extended 10 months and 8 months
    respectively.

    Of course, Jan 6 vs last Sunday in April, may have been the extra month.

    : (AIX is not among the OSes listed as using that database.)

    HP-UX doesn't use it either.

    : Does anyone know if this is a bug? If so, is there a patch for this? Or
    : maybe it is a matter of dispute?!

    I think HP-UX just got it from USL and never looked hard at it??

    If you think this is a but on HP-UX, you'll need to contact the Response
    Center and file a bug report.

+ Reply to Thread