I am receiving a JSON string that contains a date that looks like this: 2015-07-09T08:38:49-07:00
where the last part is the timezone. Is there a standard way to convert this to a DateTimeOffset
?
Here is what I have so far:
var olu = JsonConvert.DeserializeObject<OneLoginUser>(jToken.ToString(), new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd'T'HH:mm:sszzz" });
This doesn't deserialize any of the dates. I've tried using -Z
and hh:mm
for the timezone data, but I can't seem to deserialize any of the dates.
For reference, this is from OneLogin, a SSO provider. Here's a link to the user documentation. Notice the bit about the dates at the top.