469,623 Members | 1,620 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

How to convert a date string to datetime value with custom date format?

ABC
How to convert a date string to datetime value with custom date format?

e.g.
Date String Date Format Result (DateTime value)
"05/07/2004" "MM/dd/yyyy" May 7, 2004
"01062005" "ddMMyyyy" June 1, 2005
"09-07-05" "MM-dd-yy" Sept 7, 2005

Is there any functions to convert?
Nov 17 '05 #1
1 2844
Hello,
You can use DateTime.Prase static method. You will have to provide the
format (IFormatProvider) using the
System.Globalization.DateTimeFormatInfo class. Please see MSDN for the
1. DateTime.Prase method
2. DateTimeFormatInfo class

HTH. Cheers.

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Rob T | last post: by
19 posts views Thread by simon | last post: by
21 posts views Thread by Darin | last post: by
4 posts views Thread by Ashraf Ansari | last post: by
3 posts views Thread by =?Utf-8?B?U2hlbGRvbg==?= | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.