1、to_date:日期时间转日期函数
select to_date('2020-04-10 10:00:00')
输出:2020-04-10
2、from_unixtime:转换unix时间戳到当前时区的时间格式
select from_unixtime(1578585840,’yyyyMMdd’);
输出:20200410
3、unix_timestamp:获取当前unix时间戳
select unix_timestamp()
输出:1586488760
select unix_timestamp('2020-04-10 10:51:20')
输出:1586487080
4、year、month、day、hour、minute、second、weekoryear:返回日期中的年、月、日、时、分、秒、当前周数
select year('2020-04-10 10:00:00')
输出:2020
select month('2020-04-10 10:00:00')
输出:04
select day('2020-04-10 10:00:00')
输出:10
select hour('2020-04-10 10:00:00')
输出:10
select minute('2020-04-10 10:09:21')
输出:09
select second('2020-04-10 10:09:21')
输出:21
select weekofyear('2020-04-10 10:09:21')
输出:15
5、datediff:返回开始日期减去结束日期的天数
select datediff('2020-