.

DateTime.Parse US/UK etc

 

string date_input = "7/21/2011 12:00:00 AM";
var format = "M/d/yyyy hh:mm:ss tt";
var provider = new System.Globalization.CultureInfo("en-US");
DateTime dt = DateTime.ParseExact(date_input,format,provider);
Console.WriteLine("{0} converts to {1}.", date_input, dt.ToString());
//output: '7/21/2011 12:00:00 AM converts to 21/07/2011 00:00:00'

What's your thoughts on this?

*

Protected by WP Anti Spam