sql获取各种时间格式的方法

select convert(varchar(50),getdate(),101)--月/日/年

select convert(varchar(50),getdate(),102)--年.月.日 (常用)

select convert(varchar(50),getdate(),103)--日/月/年

select convert(varchar(50),getdate(),104)--日.月.年

select convert(varchar(50),getdate(),105)--日-月-年

select convert(varchar(50),getdate(),106)--日 月 年

 

转载于:https://www.cnblogs.com/iStu/p/8590421.html

你可能感兴趣的:(sql获取各种时间格式的方法)