获取系统当前时间----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 '秒'

 

你可能感兴趣的:(数据库)