How to parse string into date?

后端 未结 6 1860
闹比i
闹比i 2020-12-04 16:37

How can I convert a String to a Date in T-SQL?

My test case is the string: \'24.04.2012\'

6条回答
  •  清歌不尽
    2020-12-04 17:14

    CONVERT(DateTime, ExpireDate, 121) AS ExpireDate
    

    will do what is needed, result:

    2012-04-24 00:00:00.000
    

提交回复
热议问题