I have the following string:
20150521T205510Z
How do I go about converting this to DateTime? Do I need to parse the date first then time? Or is there a way to plug this into DateTime.Parse() to get the correct value?
You could try something like this:
var dateString = "20150521T205510Z";
var date = DateTime.ParseExact(dateString,
"yyyyMMdd'T'HHmmss'Z'",
CultureInfo.InvariantCulture);
I referenced the answer from: DateTime.Parse("2012-09-30T23:00:00.0000000Z") always converts to DateTimeKind.Local
Use function DateTime.ParseExact.
Additional information: https://msdn.microsoft.com/en-us/library/w2sa9yss%28v=vs.110%29.aspx