# date-fns changelog > Modular date utility library for JavaScript, tree-shakeable function by function. - Vendor: date-fns - Category: Frameworks & Libraries - Official site: https://date-fns.org - Tracked by: What's New (https://whatsnew.fyi/product/date-fns) - Harvested from: GitHub (date-fns/date-fns) - Entries below: 10 (newest first) What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. ## Releases ### v5.0.0-alpha.0 - Date: 2026-05-29 - Version: v5.0.0-alpha.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v5.0.0-alpha.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v5.0.0-alpha.0 - Labels: Pre-release - **removed** — Remove CDN scripts from the date-fns package and move them to the separate @date-fns/cdn package - **changed** — Reduce zipped package size from 5.83 MB to 2.89 MB v5 focuses on reducing the date-fns package size. Compared to v4.3.0, this version reduces the zipped package size from `5.83 MB` down to `2.89 MB`. It removes the CDN scripts from the `date-fns` package and moves them to a separate `@date-fns/cdn` package. It is just the first step in optimizing the package size. Expect further size reduction in the future versions. ###### Changed - **BREAKING**: The CDN scripts are now available via the `@date-fns/cdn` npm package instead of `date-fns`. Users relying on the latest CDN version (e.g., `https://cdn.jsdelivr.net/npm/date-fns/cdn.min.js`) would be served a polyfill that inserts a script with the correct URL (`https://cdn.jsdelivr.net/npm/@date-fns/cdn/cdn.min.js`) into the page. ### v4.4.0 - Date: 2026-05-29 - Version: v4.4.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.4.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.4.0 - **deprecated** — The date-fns CDN scripts are now deprecated and will be removed in the next major release - **removed** — Removed CDN source maps to reduce the package size - **added** — Introduced new package @date-fns/cdn for CDN usage This release revisits the approach to CDN usage and introduces a new package, `@date-fns/cdn` and deprecates the `date-fns` CDN scripts. It allowed reducing the zipped package size from `5.83 MB` down to `3.96 MB` without introducing any breaking changes. In `v5.0.0-alpha.0` where CDN scripts are completely removed from `date-fns` the change is more significant and brings the zipped package size down to `2.89 MB`. It is just the first step in optimizing the package size. Expect further size reduction in the future v4 and v5 versions. ###### Changed - **DEPRECATED**: The `date-fns` CDN scripts are now deprecated and will be removed in the next major release. Please switch to the new `@date-fns/cdn` package for CDN usage. - Removed CDN source maps to reduce the package size. If you rely on them, please switch to the new `@date-fns/cdn` package that still includes them. ### v4.3.0 - Date: 2026-05-22 - Version: v4.3.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.3.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.3.0 - **fixed** — Fixed missing modularized optimization fallback for Next.js and others - **fixed** — Fixed pt locale first day of week to be Sunday - **fixed** — Fixed zh-CN, zh-HK, and zh-TW locale month parsing for October, November, and December Kudos to [@ImRodry](https://github.com/ImRodry) and [@puneetdixit200](https://github.com/puneetdixit200) for their contributions. ###### Fixed - Fixed missing modularized optimization fallback ([for Next.js and others](https://x.com/kossnocorp/status/1731181274579325260)). See [#4193](https://x.com/kossnocorp/status/1731181274579325260). - Fixed `pt` locale first day of week to be Sunday. See [#4195](https://github.com/date-fns/date-fns/pull/4195) by [@ImRodry](https://github.com/ImRodry). - Fixed `zh-CN`, `zh-HK`, and `zh-TW` locale month parsing for October, November, and December. See [#4194](https://github.com/date-fns/date-fns/pull/4194) by [@puneetdixit200](https://github.com/puneetdixit200). ### v4.2.1 - Date: 2026-05-18 - Version: v4.2.1 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.2.1 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.2.1 - **fixed** — Fixed type definitions missing in v4.2.0 due to TypeScript misconfiguration ###### Fixed - Fixed type definitions missing in v4.2.0 due to TypeScript misconfiguration. ### v4.2.0 - Date: 2026-05-18 - Version: v4.2.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.2.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.2.0 - **changed** — Added Temporal API references to the JSDoc annotations of add, addBusinessDays, and addDays This is a minor release in all senses, it only includes documentation updates (first of many) that points to the new [You Don't Need date-fns\*](https://date-fns.org/you-dont-need-date-fns) page. \* Not really ###### Changed - Added Temporal API references to the JSDoc annotations of `add`, `addBusinessDays`, and `addDays`. ### v4.1.0 - Date: 2024-09-17 - Version: v4.1.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.1.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.1.0 This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs. Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14). ###### Fixed - Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#3885](https://github.com/date-fns/date-fns/issues/3885). ###### Added - Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#3886](https://github.com/date-fns/date-fns/issues/3886). ### v4.0.0 - Date: 2024-09-16 - Version: v4.0.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v4.0.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v4.0.0 I have great news! First, ten years after its release, date-fns finally gets first-class time zone support. Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward. [Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/). \- [Sasha @kossnocorp](https://twitter.com/kossnocorp) ###### Added - Added time zones support via [`@date-fns/tz`](https://github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://github.com/date-fns/tz) for the details about the API. - All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone: ```ts import { addDays, startOfDay } from "date-fns"; import { tz } from "@date-fns/tz"; startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") })); //=> "2024-09-16T00:00:00.000+08:00" ``` In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore. ###### Changed - The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers). The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`. In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`. ```ts clamp(Date.now(), { start: new TZDate(start, "Asia/Singapore"), end: new UTCDate(), }); //=> TZDate ``` - **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you run the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://github.com/date-fns/date-fns/issues/new). - **BREAKING**: The package is now ESM-first. CommonJS is still supported, and it should not affect most users, but it might break in certain environments. If you encounter any issues, please [report them](https://github.com/date-fns/date-fns/issues/new). ###### Fixed - Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE. ### v3.6.0 - Date: 2024-03-18 - Version: v3.6.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v3.6.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v3.6.0 On this release worked @kossnocorp and @world1dan. Also, thanks to @seated [for sponsoring me](https://github.com/sponsors/kossnocorp). ###### Fixed - [Fixed weeks in the Belarisuan locale's `formatDistance`.](https://github.com/date-fns/date-fns/pull/3720) ###### Added - [Added CDN versions of modules compatible with older browsers.](https://github.com/date-fns/date-fns/pull/3737) [See the CDN guide.](https://date-fns.org/docs/CDN) ### v3.5.0 - Date: 2024-03-15 - Version: v3.5.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v3.5.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v3.5.0 Kudos to @fturmel, @kossnocorp, @makstyle119, @tan75, @marcreichel, @tareknatsheh and @audunru for working on the release. Also, thanks to @seated [for sponsoring me](https://github.com/sponsors/kossnocorp). ###### Fixed - [Fixed functions that use current date internally and made them work with date extensions like `UTCDate`.](https://github.com/date-fns/date-fns/issues/3730) - [Fixed `daysToWeeks` returning negative 0.](https://github.com/date-fns/date-fns/commit/882ced61c692c7c4a79eaaec6eb07cb9c8c9195b) - [Fixed German grammar for the "half a minute" string.](https://github.com/date-fns/date-fns/pull/3715) ###### Added - [Added the Northern Sámi (`se`) locale.](https://github.com/date-fns/date-fns/pull/3724) - Added the `constructNow` function that creates the current date using the passed reference date's constructor. ### v3.4.0 - Date: 2024-03-11 - Version: v3.4.0 - Original notes: https://github.com/date-fns/date-fns/releases/tag/v3.4.0 - Permalink: https://whatsnew.fyi/product/date-fns/releases/v3.4.0 Kudos to @kossnocorp, @sakamossan, and @Revan99 for working on the release. Also, thanks to @seated for sponsoring me. ###### Added - [Added `roundToNearestHours` function.](https://github.com/date-fns/date-fns/pull/2752) - [Added Central Kurdish (`ckb`) locale.](https://github.com/date-fns/date-fns/pull/3421)