HIve时间函数
1、hive取得当前日期时间:
1.1) 取得当前日期:
select current_date();
1.2) 取得当前日期时间:
select current_timestamp();
1.3) hive取得当前时间戳:
select unix_timestamp();
1.4) 时间戳转日期:
select from_unixtime(1517725479,‘yyyy-MM-dd HH:dd:ss’);
1.5) 日期转unix时间戳:
select to_nuix_timestamp(‘2020-11-11 12:12:12’,‘yyyy-MM-dd HH:dd:ss’);
1.6) hive取得当前时间:
select from_unixtime(unix_timestamp(),‘yyyy-MM-dd HH:dd:ss’);
2、hive自动计算其他日期(昨天,今天):
hive中日期加/减函数:date_