Hive时间函数笔记

unix_timestamp()函数:

返回值: bigint
说明: 获得当前时区的UNIX时间戳

举例:

hive> select unix_timestamp() from dual;
1455616811
hive> select unix_timestamp('20180303','yyyyMMdd') from dual;
1520006400
hive> select unix_timestamp('20180303','yyyyMM') from dual;
2308752000
hive> select unix_timestamp('20180304','yyyyMM') from dual;
2311430400

hive> select unix_timestamp('201803','yyyyMM') from dual; 1519833600

hive> select unix_timestamp('20180301','yyyyMM') from dual; 2303654400
 

 

posted @ 2019-03-28 13:56  踏叶乘风  阅读(282)  评论(0编辑  收藏  举报