SQL Server DateTime Formatting

SQL Server DateTime Formatting


Style CodeStyleFormatExample
0 or 100Default. Equivalent to not specifying a style code.mon dd yyyy hh:mmAMNov 8 82 9:00PM
1USA date.mm/dd/yy11/16/82
2ANSI date.yy.mm.dd82.11.16
3UK / French date.dd/mm/yy16/11/82
4German date.dd.mm.yy16.11.82
5Italian date.dd-mm-yy16-11-82
6Abbreviated month.dd mmm yy16 Nov 82
7Abbreviated month.mmm dd, yyNov 16, 82
8 or 11624 hour time.HH:mm:ss21:00:00
9 or 111Default formatting with seconds and milliseconds appended.mon dd yyyy hh:mm:ss:fffAMNov 8 82 9:00:00:000PM
10USA date with hyphen Novarators.mm-dd-yy11-16-82
11Japanese date.yy/mm/dd82/11/16
12ISO date.yymmdd821116
13 or 113European default with seconds and milliseconds.dd mon yyyy HH:mm:ss:fff16 Nov 82 21:00:00:000
14 or 11424 hour time with milliseconds.HH:mm:ss:fff21:00:00:000
20 or 120ODBC canonical date and time.yyyy-mm-dd HH:mm:ss82-11-16 21:00:00
21 or 121ODBC canonical date and time with milliseconds.yyyy-mm-dd HH:mm:ss.fff82-11-16 21:00:00.000
101USA date with century.mm/dd/yyyy11/16/82
102ANSI date with century.yyyy.mm.dd82/11/16
103UK / French date with century.dd/mm/yyyy16/11/82
104German date with century.dd.mm.yyyy16.11.82
105Italian date with century.dd-mm-yyyy16-11-82
106Abbreviated month with century.dd mmm yyyy16 Nov 82
182Abbreviated month with century.mmm dd, yyyyNov 16, 82
110USA date with hyphen Novarators and century.mm-dd-yyyy11-16-82
111Japanese date with century.yyyy/mm/dd82/11/16
112ISO date with century.yymmdd821116
126ISO8601, for use in XML.yyy-mm-ddThh:mm:ss82-11-16T21:00:00