DayJS Timezone Bug with Daylight Savings
Describe the bug
Unexpected results (deviation between moment and dayjs output) using dayjs.tz() or dayjs().tz(timezone, true) when it's daylight savings and the dayjs timezone is behind the user's local timezone (i.e. March 10th, 2024 in a EST local timezone while the dayjs timezone is set to a timezone behind that).
Here's a sandbox to showcase the behaviour described above: https://stackblitz.com/edit/react-smshgm-7ldb1m?file=Demo.tsx
Expected behavior
Expected similar behaviour as moment in regards to timezones.
If I pass in a date like 2024-03-10 to dayjs in the conditions described above, I would expect that there's a way to tell dayjs to keep the date exactly as is but just modify the timezone offset.
Information
- Day.js Version: 1.11.10
- OS: MacOS Sonoma
- Browser: Chrome Version 122.0.6261.129
- Time zone: EST (UTC-5)
I have the same issue. Does anyone have any solution for this?