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

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: AW: AW: Re: tinterval - operator problems on AIX
Дата
Msg-id 3A5DD1CC.4E645A4D@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: AW: AW: Re: tinterval - operator problems on AIX  (Pete Forman <pete.forman@westerngeco.com>)
Список pgsql-hackers
> 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.

Oh, so AIX and IRIX have just one-line time zone databases? Yuck.

How about having some #if BROKEN_TIMEZONE_DATABASE code which uses both
mktime() and localtime() to derive the correct time zone? That is, call
mktime to get a time_t, then call localtime() to get the time zone info,
but only on platforms which do not get a complete result from just the
call to mktime(). In fact, we *could* check for tm->tm_isdst coming back
"-1" for every platform, then call localtime() to make a last stab at
getting a good value.

Comments?
                       - Thomas


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: AW: AW: AW: Re: tinterval - operator problems on AIX
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: UNDER?