Re: more timeofday() and "set time zone" weirdness

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: more timeofday() and "set time zone" weirdness
Дата
Msg-id 10820.1060805655@sss.pgh.pa.us
обсуждение исходный текст
Ответ на more timeofday() and "set time zone" weirdness  (jason_priebe@yahoo.com (Jason Priebe))
Ответы Re: more timeofday() and "set time zone" weirdness
Список pgsql-general
jason_priebe@yahoo.com (Jason Priebe) writes:
> foo=> select cast(timeofday() as timestamp with time zone); set time
> zone 'GMT+4'; select cast(timeofday() as timestamp with time zone);

This breaks because localtime() is broken: it returns the string "GMT"
as the time zone.  You can see the problem without any reference to
Postgres:

$ date
Wed Aug 13 16:09:56 EDT 2003
$ TZ='GMT+4' date
Wed Aug 13 16:09:57 GMT 2003
$

My advice: don't specify the time zone like that.  Use 'EST5EDT' or some
other standard timezone specifier.  Or avoid timeofday() ... now() or
current_timestamp would be better choices anyway ...

            regards, tom lane

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

Предыдущее
От: Jason Godden
Дата:
Сообщение: Re: The database is very slow !
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: Commercial support?