0

Content.ReadAsStringAsync() result adding an extra hour to datetime property.

Here is what i get when call endpoint on postman;

enter image description here

The ReadAsStringAsync json result return an extra hour to datetime property.

string result = postResponse.Content.ReadAsStringAsync().Result;

enter image description here

Why there is an extra hour added to datetime property ?

enter image description here

enter image description here

enter image description here

user1263981
  • 2,719
  • 7
  • 51
  • 89

1 Answers1

0

You should use DateTimeOffset (instantaneous time or absolute time) instead of DateTime. Read more about in that SO Anserwer about DateTime vs. DateTimeOffset.

kraego
  • 1,653
  • 1
  • 15
  • 27