I always forget how to format Date and Time in .NET whenever I need to use it, but fortunately there are Google and ASPAlliance.
Date and Time Format Patterns
All the patterns:
0 MM/dd/yyyy 01/23/2008
1 dddd, dd MMMM yyyy Wednesday, 23 January 2008
2 dddd, dd MMMM yyyy HH:mm Wednesday, 23 January 2008 16:38
3 dddd, dd MMMM yyyy hh:mm tt Wednesday, 23 January 2008 04:38 PM
4 dddd, dd MMMM yyyy H:mm Wednesday, 23 January 2008 16:38
5 dddd, dd MMMM yyyy h:mm tt Wednesday, 23 January 2008 4:38 PM
6 dddd, dd MMMM yyyy HH:mm:ss Wednesday, 23 January 2008 16:38:03
7 MM/dd/yyyy HH:mm 01/23/2008 16:38
8 MM/dd/yyyy hh:mm tt 01/23/2008 04:38 PM
9 MM/dd/yyyy H:mm 01/23/2008 16:38
10 MM/dd/yyyy h:mm tt 01/23/2008 4:38 PM
11 MM/dd/yyyy HH:mm:ss 01/23/2008 16:38:03
12 MMMM dd January 23
13 MMMM dd January 23
14 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2008-01-23T16:38:03.1183581-05:00
15 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2008-01-23T16:38:03.1183581-05:00
16 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Wed, 23 Jan 2008 16:38:03 GMT
17 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Wed, 23 Jan 2008 16:38:03 GMT
18 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2008-01-23T16:38:03
19 HH:mm 16:38
20 hh:mm tt 04:38 PM
21 H:mm 16:38
22 h:mm tt 4:38 PM
23 HH:mm:ss 16:38:03
24 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2008-01-23 16:38:03Z
25 dddd, dd MMMM yyyy HH:mm:ss Wednesday, 23 January 2008 16:38:03
26 yyyy MMMM 2008 January
27 yyyy MMMM 2008 January
The patterns for DateTime.ToString ( 'd' ) :
0 MM/dd/yyyy 01/23/2008
The patterns for DateTime.ToString ( 'D' ) :
0 dddd, dd MMMM yyyy Wednesday, 23 January 2008
The patterns for DateTime.ToString ( 'f' ) :
0 dddd, dd MMMM yyyy HH:mm Wednesday, 23 January 2008 16:38
1 dddd, dd MMMM yyyy hh:mm tt Wednesday, 23 January 2008 04:38 PM
2 dddd, dd MMMM yyyy H:mm Wednesday, 23 January 2008 16:38
3 dddd, dd MMMM yyyy h:mm tt Wednesday, 23 January 2008 4:38 PM
The patterns for DateTime.ToString ( 'F' ) :
dddd, dd MMMM yyyy HH:mm:ss Wednesday, 23 January 2008 16:38:03
The patterns for DateTime.ToString ( 'g' ) :
0 MM/dd/yyyy HH:mm 01/23/2008 16:38
1 MM/dd/yyyy hh:mm tt 01/23/2008 04:38 PM
2 MM/dd/yyyy H:mm 01/23/2008 16:38
MM/dd/yyyy h:mm tt 01/23/2008 4:38 PM
The patterns for DateTime.ToString ( 'G' ) :
MM/dd/yyyy HH:mm:ss 01/23/2008 16:38:03
The patterns for DateTime.ToString ( 'm' ) :
MMMM dd January 23
The patterns for DateTime.ToString ( 'r' ) :
ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Wed, 23 Jan 2008 16:38:03 GMT
The patterns for DateTime.ToString ( 's' ) :
yyyy'-'MM'-'dd'T'HH':'mm':'ss 2008-01-23T16:38:03
The patterns for DateTime.ToString ( 'u' ) :
yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2008-01-23 16:38:03Z
The patterns for DateTime.ToString ( 'U' ) :
dddd, dd MMMM yyyy HH:mm:ss Wednesday, 23 January 2008 16:38:03
The patterns for DateTime.ToString ( 'y' ) :
yyyy MMMM 2008 January
No comments:
Post a Comment