Marcel Ruff
2013-01-29 19:44:46 UTC
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
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