I want to pass a Date object (Date is "12/01/2019" in MM/DD/YYYY format) as JSON string to an API. But while converting this date (without considering time zone) into the JSON string, the date is changing to one day before. Please see the code given below:
var newDate = new Date("12/01/19");
console.log(newDate) // Showing Sun Dec 01 2019 00:00:00 GMT+0530 (India Standard Time)
var jsonDate = JSON.stringify(newDate);
console.log(jsonDate) // Showing "2019-11-30T18:30:00.000Z"
The Date Dec 01, 2019 changes to Nov 30, 2019. In my case, I can't consider the time or time zone. I can't use 'Moment JS' also.
Why does this happen? Can anyone specify the reason behind this weird problem?