Monthly Archives

5 Articles

Posted by .Ronald on

Date and Time Format Patterns

Date and Time Format Patterns taken from AspAlliance.com

All the patterns:
0 MM/dd/yyyy 09/28/2007
1 dddd, dd MMMM yyyy Friday, 28 September 2007
2 dddd, dd MMMM yyyy HH:mm Friday, 28 September 2007 07:06
3 dddd, dd MMMM yyyy hh:mm tt Friday, 28 September 2007 07:06 AM
4 dddd, dd MMMM yyyy H:mm Friday, 28 September 2007 7:06
5 dddd, dd MMMM yyyy h:mm tt Friday, 28 September 2007 7:06 AM
6 dddd, dd MMMM yyyy HH:mm:ss Friday, 28 September 2007 07:06:41
7 MM/dd/yyyy HH:mm 09/28/2007 07:06
8 MM/dd/yyyy hh:mm tt 09/28/2007 07:06 AM
9 MM/dd/yyyy H:mm 09/28/2007 7:06
10 MM/dd/yyyy h:mm tt 09/28/2007 7:06 AM
11 MM/dd/yyyy HH:mm:ss 09/28/2007 07:06:41
12 MMMM dd September 28
13 MMMM dd September 28
14 yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss.fffffffK 2007-09-28T07:06:41.8436420-04:00
15 yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss.fffffffK 2007-09-28T07:06:41.8436420-04:00
16 ddd, dd MMM yyyy HH’:’mm’:’ss ‘GMT’ Fri, 28 Sep 2007 07:06:41 GMT
17 ddd, dd MMM yyyy HH’:’mm’:’ss ‘GMT’ Fri, 28 Sep 2007 07:06:41 GMT
18 yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss 2007-09-28T07:06:41
19 HH:mm 07:06
20 hh:mm tt 07:06 AM
21 H:mm 7:06
22 h:mm tt 7:06 AM
23 HH:mm:ss 07:06:41
24 yyyy’-‘MM’-‘dd HH’:’mm’:’ss’Z’ 2007-09-28 07:06:41Z
25 dddd, dd MMMM yyyy HH:mm:ss Friday, 28 September 2007 07:06:41
26 yyyy MMMM 2007 September
27 yyyy MMMM 2007 September

The patterns for DateTime.ToString ( ‘d’ ) :
0 MM/dd/yyyy 09/28/2007

The patterns for DateTime.ToString ( ‘D’ ) :
0 dddd, dd MMMM yyyy Friday, 28 September 2007

The patterns for DateTime.ToString ( ‘f’ ) :
0 dddd, dd MMMM yyyy HH:mm Friday, 28 September 2007 07:06
1 dddd, dd MMMM yyyy hh:mm tt Friday, 28 September 2007 07:06 AM
2 dddd, dd MMMM yyyy H:mm Friday, 28 September 2007 7:06
3 dddd, dd MMMM yyyy h:mm tt Friday, 28 September 2007 7:06 AM

The patterns for DateTime.ToString ( ‘F’ ) :
0 dddd, dd MMMM yyyy HH:mm:ss Friday, 28 September 2007 07:06:41

The patterns for DateTime.ToString ( ‘g’ ) :
0 MM/dd/yyyy HH:mm 09/28/2007 07:06
1 MM/dd/yyyy hh:mm tt 09/28/2007 07:06 AM
2 MM/dd/yyyy H:mm 09/28/2007 7:06
3 MM/dd/yyyy h:mm tt 09/28/2007 7:06 AM

The patterns for DateTime.ToString ( ‘G’ ) :
0 MM/dd/yyyy HH:mm:ss 09/28/2007 07:06:41

The patterns for DateTime.ToString ( ‘m’ ) :
0 MMMM dd September 28

The patterns for DateTime.ToString ( ‘r’ ) :
0 ddd, dd MMM yyyy HH’:’mm’:’ss ‘GMT’ Fri, 28 Sep 2007 07:06:41 GMT

The patterns for DateTime.ToString ( ‘s’ ) :
0 yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss 2007-09-28T07:06:41

The patterns for DateTime.ToString ( ‘u’ ) :
0 yyyy’-‘MM’-‘dd HH’:’mm’:’ss’Z’ 2007-09-28 07:06:41Z

The patterns for DateTime.ToString ( ‘U’ ) :
0 dddd, dd MMMM yyyy HH:mm:ss Friday, 28 September 2007 07:06:41

The patterns for DateTime.ToString ( ‘y’ ) :
0 yyyy MMMM 2007 September