Re: time zone problem

Поиск
Список
Период
Сортировка
От Cefull Lo
Тема Re: time zone problem
Дата
Msg-id CACqWm=HxSAxc-mwqLhC8C2PK8iss7dB0aVyyLODktzCU+DYatw@mail.gmail.com
обсуждение исходный текст
Ответ на time zone problem  (Cefull Lo <cefull@gmail.com>)
Ответы Re: time zone problem  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: time zone problem  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
Hi,
I figure it out.
If only the offset from UTC is given, you may try

select current_timestamp at time zone (select name from pg_catalog.pg_timezone_names where utc_offset= interval '+8 hours' limit 1)

Would give the exact timestamp at those time zone.



On Fri, Jan 13, 2012 at 11:59 PM, Cefull Lo <cefull@gmail.com> wrote:
Hi everybody,
I'm located in Hong Kong, UTC+8 time zone. When I

select current_timestamp;

gives 

              now
-------------------------------
 2012-01-13 23:56:16.825558+08

However, when I 

select current_timestamp at time zone 'UTC+8';
I expect the result is the same as the above one. But the result is

          timezone
----------------------------
 2012-01-13 07:57:24.407825

How to get the correct timestamp at the time zone I gave?

Thanks in advance





--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GSC d- s:>++ a- C++ UL/B+++$ !P L++>+++++
E--- W+ N o-- K? w++ O? M- V- PS PE++(-) Y+
PGP++@ t 5 X R+>+++$ tv- b+++ DI++ D++
G++@ e+++>+++++ h*>--- r-- z?
-----END GEEK CODE BLOCK------

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

Предыдущее
От: Andrew Hannon
Дата:
Сообщение: Repercussions of Cancelled Autovacuum
Следующее
От: Tore Halvorsen
Дата:
Сообщение: Getting all entries in a single block with ctid