Unix Technical Forum

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

This is a discussion on AIX & HPUX C libraries report DST reversal in November 1974 (Pacific) within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> The following program does not assert when compiled and run under AIX 5.2 and HP-UX B.11.23: #include <time.h> #include ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 05:48 AM
nikkoara
 
Posts: n/a
Default 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 <time.h>
#include <assert.h>

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 05:48 AM
Tammy L Morford
 
Posts: n/a
Default 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com