I have a string that has a date stored in it.
String date = \"03-05-2013 00:00:00\";
I parsed it to Datetime as follows:
Da
The format you parse with does not dictate how the DateTime
is formatted when you convert the date back to a string. When you call ToString
on a date it pulls the format from the current culture of the thread your code is executing on (which defaults to the culture of the machine your on).
You can override this by passing the format into ToString()
i.e.
Start.ToString("dd-MM-yyyy HH:mm:ss", CultureInfo.InvariantCulture);
See Custom Date and Time Formats.