-2

I received the JSON response as below from our third party. I can not deserialize this data in the C# app with the DateTime field. How can I resolve this problem?

(https://i.stack.imgur.com/dF1LZ.png)

But in my opinion, I think it does not follow the ISO8601. So do we need to fix it from our side or from my partner's side?

Khanh Tran
  • 13
  • 4
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 16 '23 at 04:54
  • Re "*I think it does not follow the ISO8601*", Correct. // Re "*So do we need to fix it from our side or from my partner's side?*", Yes. Preferably, it should be fixed at the source. (Could be as simple as changing a `%Z` to a `%z` somewhere.) But you could handle the janky date yourself. – ikegami Aug 16 '23 at 05:11
  • Yes this format is not common but If they won't change it, you have a workaround to deserialize that format. You can set this parameter value to any string and use substring or similar to get proper datetime value to set DateTime object. – Mert Akkanat Aug 16 '23 at 12:17

0 Answers0