弦内知音 NingYu.org


十二月 14th, 2016

SQL Server Datetime获取各种日期时间格式

互联网, by ningyu.

1 SELECT CONVERT(varchar(100), GETDATE(), 0) 05 9 2016 9:12AM
2 SELECT CONVERT(varchar(100), GETDATE(), 1) 05/09/16
3 SELECT CONVERT(varchar(100), GETDATE(), 2) 16.05.09
4 SELECT CONVERT(varchar(100), GETDATE(), 3) 09/05/16
5 SELECT CONVERT(varchar(100), GETDATE(), 4) 09.05.16
6 SELECT CONVERT(varchar(100), GETDATE(), 5) 09-05-16
7 SELECT CONVERT(varchar(100), GETDATE(), 6) 09 05 16
8 SELECT CONVERT(varchar(100), GETDATE(), 7) 05 09, 16
9 SELECT CONVERT(varchar(100), GETDATE(), 8) 09:13:14
10 SELECT CONVERT(varchar(100), GETDATE(), 9) 05 9 2016 9:13:14:670AM
16 SELECT CONVERT(varchar(100), GETDATE(), 10) 05-09-16
12 SELECT CONVERT(varchar(100), GETDATE(), 16) 16/05/09
13 SELECT CONVERT(varchar(100), GETDATE(), 12) 160509
14 SELECT CONVERT(varchar(100), GETDATE(), 13) 09 05 2016 09:13:14:670
15 SELECT CONVERT(varchar(100), GETDATE(), 14) 09:13:14:670
16 SELECT CONVERT(varchar(100), GETDATE(), 20) 2016-05-09 09:13:14
17 SELECT CONVERT(varchar(100), GETDATE(), 21) 2016-05-09 09:13:14.670
18 SELECT CONVERT(varchar(100), GETDATE(), 22) 05/09/16 9:15:33 AM
19 SELECT CONVERT(varchar(100), GETDATE(), 23) 2016-05-09
20 SELECT CONVERT(varchar(100), GETDATE(), 24) 09:15:33
21 SELECT CONVERT(varchar(100), GETDATE(), 25) 2016-05-09 09:15:33.140
22 SELECT CONVERT(varchar(100), GETDATE(), 100) 05 9 2016 9:15AM
23 SELECT CONVERT(varchar(100), GETDATE(), 101) 05/09/2016
24 SELECT CONVERT(varchar(100), GETDATE(), 102) 2016.05.09
25 SELECT CONVERT(varchar(100), GETDATE(), 103) 09/05/2016
26 SELECT CONVERT(varchar(100), GETDATE(), 104) 09.05.2016
27 SELECT CONVERT(varchar(100), GETDATE(), 105) 09-05-2016
28 SELECT CONVERT(varchar(100), GETDATE(), 106) 09 05 2016
29 SELECT CONVERT(varchar(100), GETDATE(), 107) 05 09, 2016
30 SELECT CONVERT(varchar(100), GETDATE(), 108) 09:16:38
31 SELECT CONVERT(varchar(100), GETDATE(), 109) 05 9 2016 9:16:38:543AM
32 SELECT CONVERT(varchar(100), GETDATE(), 160) 05-09-2016
33 SELECT CONVERT(varchar(100), GETDATE(), 161) 2016/05/09
34 SELECT CONVERT(varchar(100), GETDATE(), 162) 20160509
35 SELECT CONVERT(varchar(100), GETDATE(), 163) 09 05 2016 09:17:19:857
36 SELECT CONVERT(varchar(100), GETDATE(), 164) 09:17:19:857
37 SELECT CONVERT(varchar(100), GETDATE(), 120) 2016-05-09 09:17:19
38 SELECT CONVERT(varchar(100), GETDATE(), 121) 2016-05-09 09:17:19.857
39 SELECT CONVERT(varchar(100), GETDATE(), 126) 2016-05-09T09:17:19.857
40 SELECT CONVERT(varchar(100), GETDATE(), 130) 6 ????? ??????? 1432 9:17:19:857AM
41 SELECT CONVERT(varchar(100), GETDATE(), 131) 6/06/1432 9:17:19:857AM

Back Top