这会是什么样的约会风格?
What kind of datestyle can this be?
我有一个 table 列定义为:
"timestamp" int8 NULL,
它存储的值如下
'1638462043745210034'
当我尝试将其转换为 timestamp 或 timestamp with time-zone
SELECT '1638462043745210034'::timestamp at time zone 'UTC' ;
它returns一个错误:
date/time field value out of range: "1638462043745210034" Hint:
Perhaps you need a different "datestyle" setting.
可以是什么datestyle,如何转换成普通时间戳?
自纪元以来看起来像纳秒:
SELECT to_timestamp(1638462043745210034 / 1000000000.0);
to_timestamp
══════════════════════════════
2021-12-02 17:20:43.74521+01
(1 row)
我有一个 table 列定义为:
"timestamp" int8 NULL,
它存储的值如下 '1638462043745210034' 当我尝试将其转换为 timestamp 或 timestamp with time-zone
SELECT '1638462043745210034'::timestamp at time zone 'UTC' ;
它returns一个错误:
date/time field value out of range: "1638462043745210034" Hint: Perhaps you need a different "datestyle" setting.
可以是什么datestyle,如何转换成普通时间戳?
自纪元以来看起来像纳秒:
SELECT to_timestamp(1638462043745210034 / 1000000000.0);
to_timestamp
══════════════════════════════
2021-12-02 17:20:43.74521+01
(1 row)