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,953
  • 8
  • 57
  • 98

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
  • 2,978
  • 2
  • 22
  • 34