SqlServer 时间格式化

select GETDATE() as '当前日期',

DateName(year,GetDate()) as '年',
DateName(month,GetDate()) as '月',
DateName(day,GetDate()) as '日',
DateName(dw,GetDate()) as '星期',
DateName(week,GetDate()) as '周数',
DateName(hour,GetDate()) as '时',
DateName(minute,GetDate()) as '分',
DateName(second,GetDate()) as '秒'

猜你喜欢

转载自www.cnblogs.com/jimmyLei/p/10662235.html
今日推荐