1

I have to parse following string to DateTime object:

2018-03-27T14:33:54.4092769+03:00

I know that there are few methods that can parse string, for example DateTime.Parse() and DateTime.ParseExact(). I checked first method but there is no specification for this exact pattern.

So how can I parse this format to DateTime object?

1 Answers1

1

That ISO 8601-format is already supported by DateTime.Parse/TryParse:

bool valid = DateTime.TryParse(strDate, out DateTime dt); // true
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939