Nir*_*ond 19 sql postgresql time
我想从一个列的纪元时间中选择日期(可读字符串),这些列long
在postgres 中有时间(以毫秒为单位)
select *, to_date(time in milli sec) from mytable
怎么做?
Yah*_*hia 30
使用
select *, to_timestamp(time in milli sec / 1000) from mytable
Run Code Online (Sandbox Code Playgroud)
有关参考资料,请参阅http://www.postgresql.org/docs/9.0/static/functions-formatting.html上的postgres文档.
Erw*_*ter 19
SELECT timestamp 'epoch' + time_in_millisec * interval '1 ms'
FROM mytable;
Run Code Online (Sandbox Code Playgroud)