1.将Date类型变成年月日时分秒的形式
select date_format(claimDate,‘%Y-%m-%d %H:%i:%s‘) as claimdate from t1
2.只要年月日的形式
select date_format(claimdate,‘%Y-%m-%d‘) as newdate from t1
3.获得星期几(英语如Monday,Tuesday...)
select DAYNAME(claimdate) as weekday from t1
时间: 2024-10-10 22:47:07