Parse YYYY-MM-DD specific string

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Sorry for the simple question but I couldnt seem to locate a satisfactory answer and Im somewhat new to DateTime handling with .net...
I have an XML string in the "YYYY-MM-DD" format that I need to put into a DateTime object. I understand I can use DateTime.Parse() to get this, but Im concerned that it may not evaluate correctly in all cases (2012-03-04 for instance).
How can I explicitly notify the Parse method that Im reading from a YYYY-MM-DD string?
I gather Im supposed to provide some sort of formatter to indicate this, though Im unsure how. Could someone provide a quick example?
Thanks, <hr class="sig Jack D. Leach (Access MVP) <br/>
http://www.utteraccess.com/wiki/index.php UtterAccess Wiki : (Articles, Functions, Classes, VB7 API Declarations and more)

View the full article
 
Back
Top