mysql
-- 日期字符串轉時間戳 select UNIX_TIMESTAMP('2019-09-01 00:00:00'); -- 時間戳轉日期 select FROM_UNIXTIME(1567267200,'%Y-%m-%d %H:%i:%s');
phoenix
DATA_TIME為BIGINT類型的毫秒時間戳
-- 日期字符串轉時間戳 select to_char(to_number(to_date('2021-03-17 23:50:47','yyyy-MM-dd HH:mm:ss','GMT+8')),'#'); -- 時間戳轉日期 select to_date(to_char(DATA_TIME/1000,'#'),'s','GMT-8');