Re: AW: AW: Re: tinterval - operator problems on AIX

From: Pete Forman <pete(dot)forman(at)westerngeco(dot)com>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: AW: AW: Re: tinterval - operator problems on AIX
Date: 2001-01-11 14:08:59
Message-ID: 14941.48763.429514.226848@kryten.bedford.waii.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 adjusted as 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(dot)forman(at)westerngeco(dot)com
MK41 7PA, UK tel:+44-1234-224798 fax:+44-1234-224804

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert B. Easter 2001-01-11 14:20:47 UNDER?
Previous Message The Hermit Hacker 2001-01-11 13:50:16 Re: Re: GiST for 7.1 !!