I'm saving a datetime like this in Backbone.js:
this.save('GameEndTime', new Date().toJSON()).done(function() {
self.score.fetch();
});
new Date().toJSON() is UTC, but when it hits my controller, it's somehow been converted to my local timezone.
I can see it right away when stepping through in Visual Studio.
Here is my controller, and I when I inspect the 'dto' parameter it's already in my local timezone.
[HttpPut("{id}")]
public virtual IActionResult Put(TId id, [FromBody] TDto dto)
{ ... }
So I'm unsure where/how it's going from UTC to local.
For example, if I write out the time in console.log in my browser and get this:
GameEndTime: "2018-10-18T19:36:46.982Z"
When it hit's my controller, it's this:
GameEndTime = {10/18/2018 3:36:46 PM}
This is when I set a breakpoint on the entrance to the api controller. So I can't figure out where it's being converted.
Has anyone ever had an issue like this?
Thanks!