I am using react date picker and getting the selected time value in the below format
Thu Oct 13 2022 00:00:00 GMT+0530 (India Standard Time)
i need to convert the above string to the below formats
(a) "2022-10-13T00:00:00+05:30" (b) "2022-11-03T18:30:00.000Z" (c) "2022-11-03T18:30:00.000Z"
i was able to achieve the format (b) and (c) using the below code
const dateStr = "Thu Oct 13 2022 00:00:00 GMT+0530"; console.log(new Date(dateStr).toUTCString());
but was not able to get the conversion for (a).also as per the logic the month is 1 month ahead and the date is 21 days ahead of the actual value passed.Any way to resolve this?