rest - Time offset value of a datetime is missing in Azure Web API application -


i have wep api hosted in azure .net core. simple crud api now. have interesting problem not find or understand reason.

in api, there datetime property usual. when post data api, time offset disappears in server side.

"datetime":"2016-08-29t05:13:21.931+03:00" +03:00 turns 00:00

can explain reason , solution?

{    "content":"test data",    "location":{       "name":"some location",       "address":"",       "latitude":41.0920448,       "longitude":28.9444847    },    "owner":{       "username":"some user",       "name":null,       "registrationtype":0,       "profilepictureurl":null    },    "datetime":"2016-08-29t05:13:21.931+03:00",    "createtime":"2016-08-29t05:13:21.7791051+00:00",    "rankingpoint":0.0 } 

1.first of azure service runnig on 00:00 timezone.

  1. if @ datetime structure has special property called kind. during serialization/deserialization property take consideration.

    datetime dt = datetime.now; // dt.kind ( local , utc etc).

    the way serialization works property @ server side json serialziation setting. option no help.

3. simple , best solution found use datetimeoffset instead of datetime.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -