码迷,mamicode.com
首页 > 数据库 > 详细

sql 获取时间的年月日等

时间:2015-09-01 10:36:00      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

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 ‘秒‘

sql 获取时间的年月日等

标签:

原文地址:http://www.cnblogs.com/jianghaidong/p/4774903.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!