(Advertisment)
German Wear Discount Shop - Click Here
[Dot]Net-Friends
Skip Navigation Links
Home
Latest
Fast Code
Articles
Tutorials
Online Resources
Forums
Login   | Hi, Guest


Exploring Custom Date Format Strings
Written By Omer Kamal On 04/02/2008

A bird's eye view on the Custom Date Format Strings

Views: 1116
Rating: 4.5
Login to Rate
omerkamal
Tagged Under: General, Language Specifications

Explanation:

 

We won't make things hard with going into long discussions. We will present only the most useful string formats of the dates:

 

1. date.ToString(); // Default string type
2/4/2008 4:40:09 PM

2. date.ToString(d M y); // from 2. to 6. are to make clear that what d, M and y stand for.
4 2 8

3. date.ToString(dd MM yy );
04 02 08

4. date.ToString(ddd MMM yyy);
Mon Feb 2008

5. date.ToString(dddd MMMM yyyy);
Monday February 2008

6. date.ToString(dd, MMMM yyyy);
04, February 2008

7. date.ToString(dd, MMMM yyyy g); // g represent  the Calender type of the Browser's Current Culture
04, February 2008 A.D.

8. date.ToString(dd MMMM yyyy zz); // z represents the time zone offset from UTC
04 February 2008 -07

9. date.ToLongDateString();
Monday, February 04, 2008

10. date.ToShortDateString();
2/4/2008

11. date.ToUniversalTime().ToString();
2/4/2008 11:40:09 PM

 

Delicious Digg reddit reddit Technorati
About the Author:

@@ Omer Kamal is a Software Developer at Elanize KG Germany. He MSc. Mathematics from Islamia University Bahawalpur, Pakistan and Certified Developer from National Institute of Electronics Islamabad, Pakistan. He is Founder of FriendsPoint.de and Dotnet-Friends.com. He is currently Involved with Microsoft Office SharePoint 2007, Microsoft Dynamics CRM, BI Portal Solutions (Microsoft Dynamics Customization) and Web Security Solutions.
Check Omer Kamal Profile

Related Useful Links:
Visitors/Readers Comments
(for questions please use The Forum)



"Be the First to Comment!"


Add your Comments

Name:  
Message:
Note: For faster response please use Forums >> for your questions instead of the comments area! (Admin)