I'm working in nodejs. I have the input has date and time "1/6/2022, 2:49:22 AM". need to convert the date and time to UTC format "2022-01-05T13:04:22.137Z". please help me with the solution.
code:
let date =new Date().toLocaleString("en-US", { timeZone: "Pacific/Chatham" }); console.log(date);
how to convert this date and time "1/6/2022, 2:49:22 AM" into UTC format "2022-01-05T13:04:22.137Z".
kindly help me with the solution.