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

Поиск
Список
Период
Сортировка
От Pete Forman
Тема Re: AW: AW: Re: tinterval - operator problems on AIX
Дата
Msg-id 14941.48763.429514.226848@kryten.bedford.waii.com
обсуждение исходный текст
Ответ на Re: AW: AW: Re: tinterval - operator problems on AIX  (Pete Forman <pete.forman@westerngeco.com>)
Список 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 по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: AW: Re: GiST for 7.1 !!
Следующее
От: "Robert B. Easter"
Дата:
Сообщение: UNDER?