ms 毫秒
select GETDATE() as '当前日期时间',
DateName(year,GetDate())+'-'+DateName(month,GetDate())+'-'+DateName...',
DateName(DAYOFYEAR,GetDate()) as '一年中的第几天',
DateName(year,GetDate()) as '年',
DateName(month,GetDate...,GetDate()) as '星期几'
select GETDATE() as '当前日期时间',
DatePart(year,GetDate())+'-'+DatePart(month,GetDate...()) as '一年中的第几周',
DatePart(DAYOFYEAR,GetDate()) as '一年中的第几天',
DatePart(year,GetDate()) as '年',
DatePart...注意:
1)因为DatePart返回类型为int类型,所以当前日期的结果是做了运算的结果
2)在多数SQL SERVER 英文版本中(以及部分繁体版),
SELECT DATENAME(month, getdate