What is the datetime format is this? and how can I convert to a normal datetime to be used in c# or sql?
2017-03-31T15:20:32.620436-04:00
What is the datetime format is this? and how can I convert to a normal datetime to be used in c# or sql?
2017-03-31T15:20:32.620436-04:00
That looks like the ISO standard formatting, and you should be able to parse it into a DateTime
object using:
var parsedDate = DateTime.Parse("2017-03-31T15:20:32.620436-04:00");
var dateString = parsedDate.ToString("O");
// dateString: "2017-03-31T12:20:32.6204360-07:00"
// Note the time has been changed to my local time zone