Re: Postgres and timezones

Поиск
Список
Период
Сортировка
От Steve Rogerson
Тема Re: Postgres and timezones
Дата
Msg-id 569F8A88.2070502@yewtc.demon.co.uk
обсуждение исходный текст
Ответ на Re: Postgres and timezones  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Ответы Re: Postgres and timezones  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
On 20/01/16 12:53, Albe Laurenz wrote:
> Steve Rogerson wrote:
>> Hi, this is wrong:
>>
>> # select to_char('2016-01-20 00:00'::timestamp at time zone 'Europe/Lisbon',
>> 'TZ');
>>  to_char
>> ---------
>>  GMT
>> (1 row)
>>
>>
>> It should be WET, "Western European Time". Is there something I'm doing wrong?
>
> That query will always give you your local timezone.
>
> Here in Austria I get:
> us
> test=> select to_char('2016-01-20 00:00'::timestamp at time zone 'Asia/Yerevan', 'TZ');
> ┌─────────┐
> │ to_char │
> ├─────────┤
> │ CET     │
> └─────────┘
> (1 row)
>
> Yours,
> Laurenz Albe
>
That seems odd, but never mind. I'll ask the direct qn then given the above is
it possible to determine the short TZ, say WET in my example.

Thinking about it, probably not as I suspect that pg only stores the offset in
seconds(?) from UTC, so once it has parsed "2016-.... 'Europe/Lisbon'" it has
lost track of the origin TZ and in that case what else could "to_char( ...,
'TZ') mean then other than the current client TZ.

Steve


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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Postgres and timezones
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Postgres and timezones