Date & Time Styles Supported by CONVERT() in SQL Server

Below is a list of date & time styles supported by the CONVERT() function in SQL Server. These are the styles that can be used as the third argument to indicate how the input value is formatted.

Without century (yy)With century (yyyy)StandardInput/output
0 or 100Default for datetime and smalldatetimemon dd yyyy hh:miAM (or PM)
1101U.S.1mm/dd/yy
101mm/dd/yyyy
2102ANSI2yy.mm.dd
102yyyy.mm.dd
3103British/French3dd/mm/yy
103dd/mm/yyyy
4104German4dd.mm.yy
104dd.mm.yyyy
5105Italian5dd-mm-yy
105dd-mm-yyyy
61066dd mon yy
106dd mon yyyy
71077Mon dd, yy
107Mon dd, yyyy
8 or 24108hh:mi:ss
9 or 109Default + millisecondsmon dd yyyy hh:mi:ss:mmmAM (or PM)
10110USA10 = mm-dd-yy
110mm-dd-yyyy
11111JAPAN11 = yy/mm/dd
111yyyy/mm/dd
12112ISO12 = yymmdd
112yyyymmdd
13 or 113Europe default + millisecondsdd mon yyyy hh:mi:ss:mmm (24-hour)
14114hh:mi:ss:mmm (24-hour)
20 or 120ODBC canonicalyyyy-mm-dd hh:mi:ss (24-hour)
21 or 25 or 121ODBC canonical (with milliseconds) default for timedatedatetime2, and datetimeoffsetyyyy-mm-dd hh:mi:ss.mmm (24-hour)
22U.S.mm/dd/yy hh:mi:ss AM (or PM)
23ISO8601yyyy-mm-dd
126ISO8601yyyy-mm-ddThh:mi:ss.mmm (no spaces)
127ISO8601 with time zone Zyyyy-MM-ddThh:mm:ss.fffZ (no spaces)
130Hijridd mon yyyy hh:mi:ss:mmmAM
131Hijridd/mm/yyyy hh:mi:ss:mmmAM

The above table is intended to be a quick reference for the date and time styles that can be used with CONVERT(). Not all styles can be used with all conversions, and there are various other factors to consider when choosing the style. See the Microsoft documentation for a full rundown on these.

Example of Usage

Here’s a quick example of how to use the above styles:

SELECT CONVERT( date, '03/01/2035', 103 );

Result:

2035-01-03

In this case I used the style of 103. This indicates that the input value is formatted in that style. If we look at the above table, we can see that 103 indicates that it’s in British/French format. This means that the input value is provided as dd/mm/yyyy.

This is important because SQL Server could have mistaken it for another format. For example, here’s what happens on my system when I omit the style argument:

SELECT CONVERT( date, '03/01/2035' );

Result:

2035-03-01

It swapped the day and month parts around. This time SQL Server interpreted the date as being in mm/dd/yyyy format. This is because my language is set to us_english. The us_english format is mm/dd/yyyy. So, the style argument enables us to override this format when we do the conversion.

Just to be clear, here’s what happens when I change the language on my system, then run the conversion again without the style argument:

SET LANGUAGE British;
SELECT CONVERT( date, '03/01/2035' );

Result:

2035-01-03

This time it didn’t swap the day and month around, because my system was already in British/French format. Either way, we can use the date styles in the above table to change how the input value is formatted.