将unix时间戳转换为H2时间戳 [英] convert unix timestamp to H2 timestamp

查看:224
本文介绍了将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.

推荐答案

好,请使用以下公式:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆