【SQL_SERVER】查询时分秒

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


image.png


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5.2 Zero

粤ICP备18035038号