Tuesday, October 2, 2007

DateTime Parse and CultureInfo problem.

Show US formatted dates in a different culture:

string dt = "1/31/2004";
CultureInfo nfo = new CultureInfo("en-US");
DateTime date = DateTime.Parse(dt, nfo);

CultureInfo nfo2 = new CultureInfo("en-GB");
Console.WriteLine(date.ToString(nfo2));

Found the code here.