subtract(years) causes incorrect date when crossing historical timezone change in Malaysia
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When parsing a date in 2081 and subtracting 100 years to get a date in 1981, the resulting date is incorrect (shifts from Dec 25 to Dec 1, a 24-day difference). This only happens in Malaysia timezone and appears to be related to Malaysia's historical timezone change on December 31, 1981 (UTC+7:30 → UTC+8:00).
**Expected behavior**
After `subtract(100, "years")`, the date should be `1981-12-25` (same day and month as the original date).
**Information**
- **dayjs version**: 1.11.19
- **Plugins**: customParseFormat, utc, timezone
- **Timezone**: Asia/Kuala_Lumpur (UTC+8, but was UTC+7:30 before Jan 1, 1982)
- **Node.js version**:v20.19.3
- **OS**: macOS
Contributor guide
Assessment
This issue has not been assessed yet.