While I have carefully read discussions on ASP.NET Parse DateTime result from ajax call to javascript date and Parsing DateTime format passed from Ajax to “dd/MM/yyyy”, my question pertains to the differences that exist.
The data I am working with is loaded from ASP.NET using AJAX.
Datetime in c#: "2019-05-04"
The result in ajax is: "/Date(1556895600000+0900)/"
An automatic addition of the time UTC offset to the DateTime value can be observed. This behavior raises a question for me - why is this happening?
How do I go about converting the above data to a DateTime format in JavaScript?
var d = new Date(("/Date(1556895600000+0900)/").match(/\d+/)[0] * 1)
console.log(d)
Upon implementing the code, a result of "2019-05-03T15:00:00.000Z" ensues, whereas what I actually desire is "2019-05-04". How should I proceed to achieve this?