gracejpw1117

2020-07-07   阅读量: 890

大数据

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;


添加CDA认证专家【维克多阿涛】,微信号:【cdashijiazhuang】,提供数据分析指导及CDA考试秘籍。已助千人通过CDA数字化人才认证。欢迎交流,共同成长!
0.0570 3 4 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子