to_timestamp behaviour

Поиск
Список
Период
Сортировка
От Marcel Ruff
Тема to_timestamp behaviour
Дата
Msg-id 510826AE.4000402@marcelruff.info
обсуждение исходный текст
Ответы Re: to_timestamp behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hi,

I do this ISO date query:

  select to_timestamp('2012-07-06T23:17:39.668Z', 'YYYY-MM-DD\THH24:MI:SS.MS'), '2012-07-06T23:17:39.668Z' AS ORIGINAL;

         to_timestamp        |         original        
----------------------------+--------------------------
 2012-07-06 03:17:39.668+00 | 2012-07-06T23:17:39.668Z
(1 row)


the result for the hour is "03" instead of the expected "23"!


Trying without the valid 'T' as separator:

watchee=# select to_timestamp('2012-07-06T23:17:39.668', 'YYYY-MM-DD HH24:MI:SS.MSZ'), '2012-07-06T23:17:39.668Z' AS ORIGINAL;
        to_timestamp        |         original        
----------------------------+--------------------------
 2012-07-06 23:17:39.668+00 | 2012-07-06T23:17:39.668Z
(1 row)

it works fine.

Shouldn't the first variant be OK as well?

Thanks
Marcel


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

Предыдущее
От: Darryl Pye
Дата:
Сообщение: Schemas and views
Следующее
От: Tom Lane
Дата:
Сообщение: Re: to_timestamp behaviour