DateTime.ToString() Patterns
I've taken this from: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm because I use it so much and would be devastated if it ever went down :)
0 | MM/dd/yyyy | 08/22/2006 |
1 | dddd, dd MMMM yyyy | Tuesday, 22 August 2006 |
2 | dddd, dd MMMM yyyy | HH:mm Tuesday, 22 August 2006 06:30 |
3 | dddd, dd MMMM yyyy | hh:mm tt Tuesday, 22 August 2006 06:30 AM |
4 | dddd, dd MMMM yyyy | H:mm Tuesday, 22 August 2006 6:30 |
5 | dddd, dd MMMM yyyy | h:mm tt Tuesday, 22 August 2006 6:30 AM |
6 | dddd, dd MMMM yyyy HH:mm:ss | Tuesday, 22 August 2006 06:30:07 |
7 | MM/dd/yyyy HH:mm | 08/22/2006 06:30 |
8 | MM/dd/yyyy hh:mm tt | 08/22/2006 06:30 AM |
9 | MM/dd/yyyy H:mm | 08/22/2006 6:30 |
10 | MM/dd/yyyy h:mm tt | 08/22/2006 6:30 AM |
10 | MM/dd/yyyy h:mm tt | 08/22/2006 6:30 AM |
10 | MM/dd/yyyy h:mm tt | 08/22/2006 6:30 AM |
11 | MM/dd/yyyy HH:mm:ss | 08/22/2006 06:30:07 |
12 | MMMM dd | August 22 |
13 | MMMM dd | August 22 |
14 | yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK | 2006-08-22T06:30:07.7199222-04:00 |
15 | yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK | 2006-08-22T06:30:07.7199222-04:00 |
16 | ddd, dd MMM yyyy HH':'mm':'ss 'GMT' | Tue, 22 Aug 2006 06:30:07 GMT |
17 | ddd, dd MMM yyyy HH':'mm':'ss 'GMT' | Tue, 22 Aug 2006 06:30:07 GMT |
18 | yyyy'-'MM'-'dd'T'HH':'mm':'ss | 2006-08-22T06:30:07 |
19 | HH:mm | 06:30 |
20 | hh:mm tt | 06:30 AM |
21 | H:mm | 6:30 |
22 | h:mm tt | 6:30 AM |
23 | HH:mm:ss | 06:30:07 |
24 | yyyy'-'MM'-'dd HH':'mm':'ss'Z' | 2006-08-22 06:30:07Z |
25 | dddd, dd MMMM yyyy HH:mm:ss | Tuesday, 22 August 2006 06:30:07 |
26 | yyyy MMMM | 2006 August |
27 | yyyy MMMM | 2006 August |
The patterns for DateTime.ToString ( 'd' ) :
The patterns for DateTime.ToString ( 'D' ) :
0 | dddd, dd MMMM yyyy | Tuesday, 22 August 2006 |
The patterns for DateTime.ToString ( 'f' ) :
0 | dddd, dd MMMM yyyy HH:mm | Tuesday, 22 August 2006 06:30 |
1 | dddd, dd MMMM yyyy hh:mm | tt Tuesday, 22 August 2006 06:30 AM |
2 | dddd, dd MMMM yyyy H:mm | Tuesday, 22 August 2006 6:30 |
3 | dddd, dd MMMM yyyy h:mm | tt Tuesday, 22 August 2006 6:30 AM |
The patterns for DateTime.ToString ( 'F' ) :
0 | dddd, dd MMMM yyyy HH:mm:ss | Tuesday, 22 August 2006 06:30:07 |
The patterns for DateTime.ToString ( 'g' ) :
0 | MM/dd/yyyy HH:mm | 08/22/2006 06:30 |
1 | MM/dd/yyyy hh:mm | tt 08/22/2006 06:30 AM |
2 | MM/dd/yyyy H:mm | 08/22/2006 6:30 |
3 | MM/dd/yyyy h:mm tt | 08/22/2006 6:30 AM |
The patterns for DateTime.ToString ( 'G' ) :
0 | MM/dd/yyyy HH:mm:ss | 08/22/2006 06:30:07 |
The patterns for DateTime.ToString ( 'm' ) :
The patterns for DateTime.ToString ( 'r' ) :
0 | ddd, dd MMM yyyy HH':'mm':'ss 'GMT' | Tue, 22 Aug 2006 06:30:07 GMT |
The patterns for DateTime.ToString ( 's' ) :
0 | yyyy'-'MM'-'dd'T'HH':'mm':'ss | 2006-08-22T06:30:07 |
The patterns for DateTime.ToString ( 'u' ) :
0 | yyyy'-'MM'-'dd HH':'mm':'ss'Z' | 2006-08-22 06:30:07Z |
The patterns for DateTime.ToString ( 'U' ) :
0 | dddd, dd MMMM yyyy HH:mm:ss | Tuesday, 22 August 2006 06:30:07 |
The patterns for DateTime.ToString ( 'y' ) :
Author: Paul Hayman
Published: Tuesday, 22 August, 2006