I want to convert the given date in a specific timezone to UTC.
I have the below date "03/26/2020 10:00 AM"
const d = new Date(dateStr);
var offset = -10; //HST
var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
var nd = new Date(utc + (3600000 * offset));
I want the final output to be in the below format, which takes the above date and time in HST timezone and gives me UTC.
2020-01-08T16:31:00Z //This will represent UTC (8:30 PM UTC)