SQL Server supports different options to format Date/Time string.
Date Convert Format | Result |
CONVERT(VARCHAR(50), GETDATE(), 100) | Oct 10 2018 4:28AM |
CONVERT(VARCHAR(50), GETDATE(), 101) | 10/10/2018 |
CONVERT(VARCHAR(50), GETDATE(), 102) | 2018.10.10 |
CONVERT(VARCHAR(50), GETDATE(), 103) | 10/10/2018 |
CONVERT(VARCHAR(50), GETDATE(), 104) | 10.10.2018 |
CONVERT(VARCHAR(50), GETDATE(), 105) | 10-10-2018 |
CONVERT(VARCHAR(50), GETDATE(), 106) | 10 Oct 2018 |
CONVERT(VARCHAR(50), GETDATE(), 107) | Oct 10, 2018 |
CONVERT(VARCHAR(50), GETDATE(), 108) | 04:28:25 |
CONVERT(VARCHAR(50), GETDATE(), 109) | Oct 10 2018 4:28:25:467AM |
CONVERT(VARCHAR(50), GETDATE(), 110) | 10-10-2018 |
CONVERT(VARCHAR(50), GETDATE(), 111) | 2018/10/10 |
CONVERT(VARCHAR(50), GETDATE(), 112) | 20181010 |
CONVERT(VARCHAR(50), GETDATE(), 113) | 10 Oct 2018 04:28:25:467 |
CONVERT(VARCHAR(50), GETDATE(), 114) | 04:28:25:467 |
CONVERT(VARCHAR(50), GETDATE(), 120) | 2018-10-10 04:28:25 |
CONVERT(VARCHAR(50), GETDATE(), 121) | 2018-10-10 04:28:25.467 |
CONVERT(VARCHAR(50), GETDATE(), 126) | 2018-10-10T04:28:25.467 |
CONVERT(VARCHAR(50), GETDATE(), 127) | 2018-10-10T04:28:25.467 |
CONVERT(VARCHAR(50), GETDATE(), 130) | 30 ???? 1440 4:28:25:467AM |
CONVERT(VARCHAR(50), GETDATE(), 131) | 30/01/1440 4:28:25:467AM |
Comments
Post a Comment