sql server 获取当前时间怎么把时分秒改为00:00:00只要年月日

2025-03-07 03:36:31
推荐回答(1个)
回答1:

还要datetime格式的话

select convert(datetime,convert(varchar(10),getdate(),120))

如果只要年月日,但是是字符格式的话

select convert(varchar(10),getdate(),120)