gracejpw1117

2020-07-07   阅读量: 857

大数据

Hive 时间戳和日期相互转换 from_unixtime和unix_timestamp

扫码加入数据分析学习群

Hive 时间戳和日期相互转换:from_unixtime和unix_timestamp

时间戳转日期

select distinct from_unixtime(1441565203,‘yyyy/MM/dd HH:mm:ss’) from test_date;

日期转时间戳

select distinct unix_timestamp(‘20111207 13:01:03’) from test_date; // 默认格式为“yyyy-MM-dd HH:mm:ss“

select distinct unix_timestamp(‘20111207 13:01:03’,‘yyyyMMdd HH:mm:ss’) from test_date;


0.0570 3 4 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子