QL 获取当前日期,年、月、日、周、时、分、秒

?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 '秒'

结果:

2009-08-13 23:07:15.403 2009 08 13 星期四 33 23 7 15

  

posted @ 2013-08-22 21:05  stevejson  阅读(400)  评论(0编辑  收藏  举报