| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера