hive中对时间处理的函数总结

日期转为时间戳
unix_timestamp('2022-11-12 00:00:00.000')
结果:1668182400

from_unixtime(unix_timestamp('2022-11-12 00:00:00.000'), 'yyyy-MM-dd')
结果:2022-11-12

将20220101类型的时间字符串转换为时间戳
unix_timestamp('20220101', 'yyyyMMdd')
from_timestamp('20220101', 'yyyyMMdd')

posted @ 2023-02-02 18:34  jsqup  阅读(19)  评论(0编辑  收藏  举报