Re: timezone difference in timestamp?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: timezone difference in timestamp?
Дата
Msg-id 20061106185620.GA857@svana.org
обсуждение исходный текст
Ответ на timezone difference in timestamp?  (meltedown <asdf@fake.com>)
Список pgsql-general
On Mon, Nov 06, 2006 at 03:30:35PM +0000, meltedown wrote:
> Short version: I'm trying to turn a unix timestamp into a psql
> timestamp, but there is a 5 hour difference. Is this because of
> timezones ? Can I just subtract 5 hours to get the right value ?

Not sure what you're using, but by my calculations postgresql is
correct.

$ perl -e 'print scalar(gmtime(1162789200)),"\n"'
Mon Nov  6 05:00:00 2006

Make sure you understand whether the dates your comparing are in the
same timezone. Maybe you want 'timestamp with time zone'.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Matt Miller"
Дата:
Сообщение: cvs HEAD initdb: vacuuming database template1 ... FATAL: could not identify a comparison function for type aclitem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: timezone difference in timestamp?