You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you write format(..., { timeZone: '...' }), this means use the local time of the Date that I provide but ignore it's absolute time because it is probably wrong. But when you write anyFunction(... { in: ... }) it means use the absolute time of the Date I give you and translate it to the specified timezone. date-fns 4 removes the need for such "Dates with probably wrong absolute time", but you will need to change the way that you construct the Date. When you write new Date('2023-03-20T11:11:00'), that Date will be in the local system timezone. That is the smoking gun.
To create a proper Date for your use case, you can write:
date-fns-tz
@date-fns/tz
How to get the date-fns-tz behavior with @date-fns/tz?
The text was updated successfully, but these errors were encountered: