Bug #672: timestamp() converts timezone in wrong direction

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #672: timestamp() converts timezone in wrong direction
Дата
Msg-id 20020522155435.59C08475E71@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #672: timestamp() converts timezone in wrong direction  (Edwin Grubbs <egrubbs@rackspace.com>)
Список pgsql-bugs
Simon Kirby (sim@netnation.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
timestamp() converts timezone in wrong direction

Long Description
timestamp() and extracting epoch from dates is totally broken:

db=# select "timestamp"(0);
      timestamp
---------------------
 1970-01-01 08:00:00
(1 row)

This should be the same as "perl -le 'print scalar localtime(0)'", which
prints:

Wed Dec 31 16:00:00 1969

db=# select extract(epoch from "timestamp"(0));
 date_part
-----------
     28800
(1 row)

timestamps should never be stored with timezones because that would
remove the ability to describe times which overlap in daylight savings
transitions.  It looks like timestamp() is converting in the wrong
direction, and extract() is as well.

Sample Code


No file was uploaded with this report

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug #671: server corrupt
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug #671: server corrupt