CodeInstance:
Select Convert ( Varchar ( 10 ), Getdate (), 121 ) -- Do not set the time To 2002-01-01
Select Convert ( Varchar ( 10 ), Getdate (), 120 ) -- Do not time 2002-1-1
Select Convert ( Char ( 8 ), Getdate (), 112 ) -- 20020101
Select Convert ( Char ( 8 ), Getdate (), 108 ) -- 06:05:05
Standard:
1 101 us mm/DD/YYYY
2 102 ANSI yy. Mm. dd
3 103 UK/French dd/mm/yy
4 104 German dd. mm. yy
5 105 Italian DD-mm-yy
6 106-dd mon YY
7 107-mon DD, YY
8 108-hh: mm: SS
9 or 109 (*) Default Value + millisecond mon dd yyyy hh: MI: SS: mmmam (or pm)
10 110 US mm-dd-yy
11 111 YY/MM/DD in Japan
12 112 ISO yymmdd
13 or 113 (*) European default value + millisecond dd mon yyyy hh: mm: SS: Mmm (24 h)
14 114-hh: MI: SS: Mmm (24 h)
20 or 120 (*) ODBC specification yyyy-mm-dd hh: mm: ss [. fff]
21 or 121 (*) ODBC specification (with millisecond) yyyy-mm-dd hh: mm: ss [. fff]
126 (***) iso8601 yyyy-mm-dd thh: mm: SS: Mmm (without spaces)
130 * Kuwait dd mon yyyy hh: MI: SS: mmmam
131 * Kuwait dd/mm/yy hh: MI: SS: mmmam