将 unix 时间戳转换为 H2 时间戳 [英] convert unix timestamp to H2 timestamp
本文介绍了将 unix 时间戳转换为 H2 时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将像 1348560343598
这样的 unix 时间戳值转换为 H2 Timestamp
?
How do I convert unix timestamp value like 1348560343598
to H2 Timestamp
?
我的一个表在 BIGINT(19)
列中包含这些 unix 时间戳,我需要将它们转换为 TIMESTAMP
类型的列.
One of my tables contains these unix timestamps in a BIGINT(19)
column and I need to convert them to a column of type TIMESTAMP
.
推荐答案
好的,使用以下公式即可:
Ok, using the following formula works:
select DATEADD('SECOND', 1348560343, DATE '1970-01-01')
只要记住将时间戳除以 1000.使用 'MILLISECOND'
不起作用,你会得到 Numeric value out of range
.
Just remember to divide the timestamp with 1000. Using 'MILLISECOND'
doesn't work, you will get Numeric value out of range
.
这篇关于将 unix 时间戳转换为 H2 时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文