i have a big problem with a DateTime-Format after deserializing a json-string to a Dataset.
Dim formatter = new JsonSerializerSettings() With { .DateFormatString = "yyyy-MM-ddThh:mm:ssZ" }
Dim json = JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.Indented,formatter)
After this two lines I get a well formed DateTime-Format (e.g. "2015-11-24T09:36:00Z")
But after that, I have to convert this json-string to a DataSet-Object. I do it like this:
Dim ds = JsonConvert.DeserializeObject(Of DataSet)(json,formatter)
And now, the DateTime-Value looks like this: "11/24/2015 09:36:00"
Finally this value ends in an Exception, that it is not a valide DateTime, if I want do parse it to an DateTime...
DateTime.Parse("11/24/2015 09:36:00")
So maybe there are some formatters which i have to use? I don't know...
Hope you can help me! Thank you in advance!
EDIT: Sample-Jsonstring:
{"records":[{"Key":"EIG*11111","ChangeDate":"2015-11-24T09:36:00Z"}]}
This ChangeDate will be formatted to #11/24/2015 09:36:00 AM# in the DataRow