一、随机示例(想到哪里写哪里)
1.系统时间函数
查询
select
current_timestamp --当前格式化时间
,current_date --当前格式化日期...,unix_timestamp() --当前unix时间戳
结果:
2.时间函数转换
查询
--将时间戳转化为格式化时间
select
from_unixtime(1725865044...,'yyyy-MM-dd')
,from_unixtime(1725865044,'yyyy-MM')
,from_unixtime(1725865044,'dd')
结果
查询
--时间格式化为日期...,'yyyy-MM-dd')
,date_format('2024-09-09','yyyy-MM')
,date_format('2024-09-09','yyyy')
结果
3.时间函数