So, I live in Philippines (GMT+8) my current time is June 1, 2020, 3:20 PM
The current UTC time is June 1 2020, 7:20 AM
.
I want it so I can manipulate the date using Pacific/Honolulu
(GMT-10) and the current time there is 31 May 2020, 9:20 PM
like:
const date = new Date();
date.setDate(l.getDate() + 1)
console.log(date)
// ...further manipulation of date
date.getTime() //unix timestamp
this will show the local timezone which is GMT+8.
So I want to choose a timezone, manipulate the date, then get the UTC timestamp of that manipulated date.
I tried various method like converting it first to UTC, but no luck - still can't seem to find any workaround to this.
I'm using timezone-support and date-fns (if this helps) in my project (sorry I can't use moment js) as the project is already quite big and is using date-fns for a long time.