I use a web service that returns some dates to me as a string, and I use DateTime.Parseto get the corresponding objects DateTime. It works, but I'm afraid that my use DateTime.Parsemay be vulnerable to errors caused by various language settings. The returned date has the following format:
2014-04-24T00:00:00
The code I use to analyze it:
DateTime d = DateTime.Parse(strValue);
Is there any way (for example, passing the format provider or using another method) in which I guarantee that my parsing procedure will work regardless of the locale settings?
source
share