Re: Inconsistency of timezones in postgresql
От | David G. Johnston |
---|---|
Тема | Re: Inconsistency of timezones in postgresql |
Дата | |
Msg-id | CAKFQuwbuU3ULeoXO5MPjWbRx2-2hn7KCpzV69tMdcS3hKJb9HA@mail.gmail.com обсуждение исходный текст |
Ответ на | Inconsistency of timezones in postgresql (Chris BSomething <xpusostomos@gmail.com>) |
Ответы |
Re: Inconsistency of timezones in postgresql
|
Список | pgsql-bugs |
Please reply-all to keep the list involved.
ibis=# set time zone 'UTC';SET
From this point on all timestamptz outputs will be shown to you in “+00” since your time zone is set to UTC
ibis=# select update_date at time zone 'Australia/Sydney' from collection_item where item_id=2197;
timezone
------------------------
2012-07-06 02:59:55+00
The input timestamp is noon. Turn it into a string. Concatenate “Australia/Sydney” to it. Cast that to timestamptz. Then rotate that 12pm Sydney time to UTC - resulting in 2AM. Print 2am to the screen with a “+00” suffix to indicate that what you are seeing is a timestamptz value displayed in your UTC specified time zone.
I.e. your just wrote something similar to (in common terms):
Select ‘2012-07-06 12:59:55+10’::timezone at time zone UTC
David J.
В списке pgsql-bugs по дате отправления: