I'm trying to convert a date in GMT to PST. The GMT date is 2022-11-16T00:00:00
, therefore the PST date should be 2022-11-15T16:00:00
.
My code is as follows:
const startDateGMT = moment(startTime).tz(myTimezone, true);
console.log('START DATE GMT IS', startDateGMT, startDateGMT.toISOString());
This outputs 8AM on the 16th, instead of 4PM on the 15th:
START DATE GMT IS Moment<2022-11-16T00:00:00-08:00> 2022-11-16T08:00:00.000Z
What am I doing wrong?