When I create a Buyin object, the response from the ASP.NET MVC controller ( return Json(response, JsonRequestBehavior.AllowGet); ) looks like this:
"Buyin": { "Id": 95, "PlayerSessionId": 88, "PlayerId": 45, "PlayerName": "Alan", "Amount": 888, "BuyinType": "Credits", "Description": null, "Authorized": true, "SignPath": "~/Signs/Buyins\\95.png", "Payment": null, "CreationDate": "/Date(1477242738042)/" },
If I convert it to Epoch Converter , I get this time: GMT: Sun, 23 Oct 2016 17:12:18.042 GMT
In the database, the stored datetime seems to be correct:
95 NULL 1 1 2016-10-23 17:12:18.043
When the response is sent, Kind set to UTC .
Now I call the controller to get all my data, and all the dates added a few hours to it:
{ "Id": 95, "PlayerSessionId": 88, "PlayerId": 45, "PlayerName": "Alan", "Amount": 888, "BuyinType": "Credits", "Description": null, "Authorized": true, "SignPath": "~/Signs/Buyins\\95.png", "Payment": null, "CreationDate": "/Date(1477267938043)/" }
1477267938043 = GMT: Mon, 24 Oct 2016 00:12:18.043 GMT
However, when I request this object, I see that the actual object has the correct date: 
But the Kind parameter is set to Unspecified , so I think this is causing the problem.
At the moment, I have not set any globalization settings.
So basically, my question is: when ASP.NET MVC loads dates from the database, is there any way to tell the server to load dates with Kind set to UTC , since I think this is the problem?
The database is saved and loaded using the Entity Framework.
Update after accepted answer
The accepted answer was wonderful, however my date values ββwere already stored in the database as UTC dates, so I changed GetDateTime to this: public override DateTime GetDateTime (int serial number)
{ var date = base.GetDateTime(ordinal); var utcDate = DateTime.SpecifyKind(date, DateTimeKind.Utc); return utcDate;