Re: AW: AW: Re: tinterval - operator problems on AIX - Mailing list pgsql-hackers

From Pete Forman
Subject Re: AW: AW: Re: tinterval - operator problems on AIX
Date
Msg-id 14941.48763.429514.226848@kryten.bedford.waii.com
Whole thread Raw
In response to Re: AW: AW: Re: tinterval - operator problems on AIX  (Pete Forman <pete.forman@westerngeco.com>)
List pgsql-hackers
Pete Forman writes:> One workaround would be to add 4*n to tm_year and subtract (365*4+1)> *24*60*60*n from the time_t
returned. (All leap years are multiples> of 4 in the range 1901 to 2038.  If tm_wday is wanted, that will need> to be
adjustedas well.)
 

FWIW, that should be to add 28*n to tm_year and subtract (365*4+1)*7
*24*60*60*n from the time_t returned.  That calculates tm_wday
correctly.

Also I should have been more explicit that this applies only to AIX
and IRIX.  Those return -1 from mktime(year < 1970) and do not allow
DST rules to vary from year to year.  Linux and Solaris have more
capable date libraries.
-- 
Pete Forman   http://www.bedford.waii.com/wsdev/petef/PeteF_links.html
WesternGeco                           http://www.crosswinds.net/~petef
Manton Lane, Bedford,               mailto:pete.forman@westerngeco.com
MK41 7PA, UK                  tel:+44-1234-224798  fax:+44-1234-224804


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: AW: Re: GiST for 7.1 !!
Next
From: "Robert B. Easter"
Date:
Subject: UNDER?