函数-Convert-日期

输出指定格式日期

Style IDSQL对应格式
1SELECT CONVERT(varchar(100), GETDATE(), 1);01/03/17
2SELECT CONVERT(varchar(100), GETDATE(), 2);17.01.03
3SELECT CONVERT(varchar(100), GETDATE(), 3);03/01/17
4SELECT CONVERT(varchar(100), GETDATE(), 4);03.01.17
5SELECT CONVERT(varchar(100), GETDATE(), 5);03-01-17
6SELECT CONVERT(varchar(100), GETDATE(), 6);03 01 17
7SELECT CONVERT(varchar(100), GETDATE(), 7);01 03, 17
8SELECT CONVERT(varchar(100), GETDATE(), 8);09:09:10
9SELECT CONVERT(varchar(100), GETDATE(), 9);01 3 2017 9:09:10:037AM
10SELECT CONVERT(varchar(100), GETDATE(), 10);01-03-17
11SELECT CONVERT(varchar(100), GETDATE(), 11);17/01/03
12SELECT CONVERT(varchar(100), GETDATE(), 12);170103
13SELECT CONVERT(varchar(100), GETDATE(), 13);03 01 2017 09:09:10:037
14SELECT CONVERT(varchar(100), GETDATE(), 14);09:09:10:037
20SELECT CONVERT(varchar(100), GETDATE(), 20);2017-01-03 09:09:10
21SELECT CONVERT(varchar(100), GETDATE(), 21);2017-01-03 09:09:10.037
22SELECT CONVERT(varchar(100), GETDATE(), 22);01/03/17 9:09:10 AM
23SELECT CONVERT(varchar(100), GETDATE(), 23);2017-01-03
24SELECT CONVERT(varchar(100), GETDATE(), 24);09:09:10
25SELECT CONVERT(varchar(100), GETDATE(), 25);2017-01-03 09:09:10.037
100SELECT CONVERT(varchar(100), GETDATE(), 100);01 3 2017 9:09AM
101SELECT CONVERT(varchar(100), GETDATE(), 101);01/03/2017
102SELECT CONVERT(varchar(100), GETDATE(), 102);2017.01.03
103SELECT CONVERT(varchar(100), GETDATE(), 103);03/01/2017
104SELECT CONVERT(varchar(100), GETDATE(), 104);03.01.2017
105SELECT CONVERT(varchar(100), GETDATE(), 105);03-01-2017
106SELECT CONVERT(varchar(100), GETDATE(), 106);03 01 2017
107SELECT CONVERT(varchar(100), GETDATE(), 107);01 03, 2017
108SELECT CONVERT(varchar(100), GETDATE(), 108);09:09:10
109SELECT CONVERT(varchar(100), GETDATE(), 109);01 3 2017 9:09:10:037AM
110SELECT CONVERT(varchar(100), GETDATE(), 110);01-03-2017
111SELECT CONVERT(varchar(100), GETDATE(), 111);2017/01/03
112SELECT CONVERT(varchar(100), GETDATE(), 112);20170103
113SELECT CONVERT(varchar(100), GETDATE(), 113);03 01 2017 09:09:10:037
114SELECT CONVERT(varchar(100), GETDATE(), 114);09:09:10:037
120SELECT CONVERT(varchar(100), GETDATE(), 120);2017-01-03 09:09:10
121SELECT CONVERT(varchar(100), GETDATE(), 121);2017-01-03 09:09:10.037
126SELECT CONVERT(varchar(100), GETDATE(), 126);2017-01-03T09:09:10.037
130SELECT CONVERT(varchar(100), GETDATE(), 130);5 ???? ?????? 1438 9:09:10:037AM
131SELECT CONVERT(varchar(100), GETDATE(), 131);5/04/1438 9:09:10:037AM

sql sqlserver 日期