how to format getdate into YYYYMMDDHHmmSS

后端 未结 7 1506
春和景丽
春和景丽 2021-02-19 04:50

In SQL Server how do I format getdate() output into YYYYMMDDHHmmSS where HH is 24 hour format?

I\'ve got the YYYYMMDD

7条回答
  •  执笔经年
    2021-02-19 05:35

    select replace(
           replace(
           replace(convert(varchar(19), getdate(), 126),
           '-',''),
           'T',''),
           ':','')
    

提交回复
热议问题