时间戳
select unix_timestamp('20201231','yyyyMMdd')> 1609372800select unix_timestamp('2020-12-31','yyyy-MM-dd')> 1609372800
日期格式转换
select from_unixtime(1609372800,'yyyy-MM-dd')> 2020-12-31select from_unixtime(1609372800,'yyyyMMdd')> 20201231
注意: 该函数 FUNC(bigint, string) 要求第一个参数必须为整型,若为字符串则会报错! 例如:select from_unixtime(‘1609372800’,’yyyyMMdd’); —> [Error 10014]
日期差
select datediff('2020-12-31','2020-01-01'); -- 两个输入参数必须为'日期格式'> 365
