Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 unix 时间戳值转换1348560343598为 H2 Timestamp?
1348560343598
Timestamp
我的一个表在一列中包含这些 unix 时间戳,BIGINT(19)我需要将它们转换为一列类型TIMESTAMP。
BIGINT(19)
TIMESTAMP
好的,使用以下公式有效:
select DATEADD('SECOND', 1348560343, DATE '1970-01-01')
只要记住将时间戳除以 1000。使用'MILLISECOND'不起作用,你会得到Numeric value out of range.
'MILLISECOND'
Numeric value out of range