Re: Postgres and timezones
От | Eelke Klein |
---|---|
Тема | Re: Postgres and timezones |
Дата | |
Msg-id | CALEkvvzTFn6zAcCJ4gVJ8T4UNYqCdD3VACdD0fGjkAM_DcCT-Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Postgres and timezones (Steve Rogerson <steve.pg@yewtc.demon.co.uk>) |
Список | pgsql-general |
2016-01-20 12:10 GMT+01:00 Steve Rogerson <steve.pg@yewtc.demon.co.uk>:
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?
Actually your input is now interpretted as being timezone Europe/Lisbon but to_char still converts it to a string for the timezone that is currently set on your connection. When I do (my connection is set to Europe/Amsterdam)
select to_char('2016-01-20 00:00'::timestamp at time zone 'Europe/Lisbon', 'HH:MI TZ');
I get 01:00 CET because it has converted it from Europe/Lisbon to CET.
You can adjust the timezone which is used for display by to_char with
set timezone='Europe/Lisbon';
Regards,
Eelke
В списке pgsql-general по дате отправления: