suroMind

[C#]DateTime ToString() 변환 패턴 본문

IT분야/C#

[C#]DateTime ToString() 변환 패턴

suroMind 2012. 1. 4. 17:20
출처 : http://wizcody.egloos.com/2471287
All the patterns:
0 MM/dd/yyyy 10/25/2007
1 dddd, dd MMMM yyyy Thursday, 25 October 2007
2 dddd, dd MMMM yyyy HH:mm Thursday, 25 October 2007 00:49
3 dddd, dd MMMM yyyy hh:mm tt Thursday, 25 October 2007 12:49 AM
4 dddd, dd MMMM yyyy H:mm Thursday, 25 October 2007 0:49
5 dddd, dd MMMM yyyy h:mm tt Thursday, 25 October 2007 12:49 AM
6 dddd, dd MMMM yyyy HH:mm:ss Thursday, 25 October 2007 00:49:38
7 MM/dd/yyyy HH:mm 10/25/2007 00:49
8 MM/dd/yyyy hh:mm tt 10/25/2007 12:49 AM
9 MM/dd/yyyy H:mm 10/25/2007 0:49
10 MM/dd/yyyy h:mm tt 10/25/2007 12:49 AM
11 MM/dd/yyyy HH:mm:ss 10/25/2007 00:49:38
12 MMMM dd October 25
13 MMMM dd October 25
14 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2007-10-25T00:49:38.0395323-04:00
15 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2007-10-25T00:49:38.0395323-04:00
16 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 25 Oct 2007 00:49:38 GMT
17 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 25 Oct 2007 00:49:38 GMT
18 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2007-10-25T00:49:38
19 HH:mm 00:49
20 hh:mm tt 12:49 AM
21 H:mm 0:49
22 h:mm tt 12:49 AM
23 HH:mm:ss 00:49:38
24 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2007-10-25 00:49:38Z
25 dddd, dd MMMM yyyy HH:mm:ss Thursday, 25 October 2007 00:49:38
26 yyyy MMMM 2007 October
27 yyyy MMMM 2007 October

The patterns for DateTime.ToString ( 'd' ) :
0 MM/dd/yyyy 10/25/2007

The patterns for DateTime.ToString ( 'D' ) :
0 dddd, dd MMMM yyyy Thursday, 25 October 2007

The patterns for DateTime.ToString ( 'f' ) :
0 dddd, dd MMMM yyyy HH:mm Thursday, 25 October 2007 00:49
1 dddd, dd MMMM yyyy hh:mm tt Thursday, 25 October 2007 12:49 AM
2 dddd, dd MMMM yyyy H:mm Thursday, 25 October 2007 0:49
3 dddd, dd MMMM yyyy h:mm tt Thursday, 25 October 2007 12:49 AM

The patterns for DateTime.ToString ( 'F' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Thursday, 25 October 2007 00:49:38

The patterns for DateTime.ToString ( 'g' ) :
0 MM/dd/yyyy HH:mm 10/25/2007 00:49
1 MM/dd/yyyy hh:mm tt 10/25/2007 12:49 AM
2 MM/dd/yyyy H:mm 10/25/2007 0:49
3 MM/dd/yyyy h:mm tt 10/25/2007 12:49 AM

The patterns for DateTime.ToString ( 'G' ) :
0 MM/dd/yyyy HH:mm:ss 10/25/2007 00:49:38

The patterns for DateTime.ToString ( 'm' ) :
0 MMMM dd October 25

The patterns for DateTime.ToString ( 'r' ) :
0 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Thu, 25 Oct 2007 00:49:38 GMT

The patterns for DateTime.ToString ( 's' ) :
0 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2007-10-25T00:49:38

The patterns for DateTime.ToString ( 'u' ) :
0 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2007-10-25 00:49:38Z

The patterns for DateTime.ToString ( 'U' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Thursday, 25 October 2007 00:49:38

The patterns for DateTime.ToString ( 'y' ) :
0 yyyy MMMM 2007 October
Comments