我在存储纪元时间的表中有一个列。
我想将其转换为人类可读的日期时间戳,时区为 IST。我正在使用以下查询,但转换不正确,它显示的是上次 05:30。
presto:default> select to_char(date_trunc('hour',
from_unixtime((CAST(substr(startdatetime,1,10) AS double )))),
'dd-mm-yyyy hh24'),startdatetime FROM rocmetricsolr limit 10;
_col0 | startdatetime
---------------+---------------
NULL | NULL
21-05-2018 23 | 1526905879116
21-05-2018 23 | 1526905879116
21-05-2018 23 | 1526905874892
NULL | NULL
21-05-2018 23 | 1526905876216
21-05-2018 23 | 1526905876216
21-05-2018 23 | 1526905873640
21-05-2018 23 | 1526905873640
21-05-2018 23 | 1526905903110