I'm converting some time checks that relied on moment-timezone to using INTL.DateTimeFormat.
For context, the code takes a user's current time in ms (Date.now()), and checks it against three time zones (each website has it's own locale):
const formatter = Intl.DateTimeFormat([], {
timeZone: timezone,
year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric',
minute: 'numeric', second: 'numeric',
})
Where timezone is either America/New_York, Europe/London or Europe/Madrid. Formatter is passed into Date.parse to get it into the appropriate ms format.
I'm having some trouble finding out if the function already accounts for daylight savings time. If not, I can do some logic elsewhere to convert the two times I'll be comparing to the appropriate DST value.
Is this something that exists already? Is it under the hood, or part of the first arg for the function? Just having trouble locating the info in the docs.