I have a date that is set in my UI from this angularjs date picker. It is set as a moment.js object and it includes a GMT offset for my timezone (Eastern). When I submit the moment object back to my Asp.net Core endpoint, the time is converted to the time with no offset. So for example, when I inspect date in the javascript moment object object:
timeIn: Fri Dec 16 2016 05:00:00 GMT-0500 (Eastern Standard Time)
And when I inspect my object in .net core:
TimeIn: 12/16/2016 10:00:00AM
I want the data on the back end to show as the exact time entered on the UI, regardless of timezone. So if they enter 5:00AM, the time backend should store is 5:00AM. It appears to change the value when the moment object is converted to JSON to send to the backend. When I do a JSON.stringify() of my timeIn object on the UI, I get:
"2016-12-16T10:00:00.000Z"
Is there a way to strip the offset data from the timezone on the front end so that the time entered is the exact same as the time sent?
P.S. I know there are a lot of questions out there about time but I wasn't able to find a suitable one for my case. Thanks for your help
EDIT: I am using .net DateTime object to accept the javascript date object.