By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,631 Members | 826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,631 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.