Date Libraries

date-fns npm Trends

Download trends, growth, and how date-fns compares to dayjs and luxon

date-fnsdayjsluxon

Weekly Downloads — Last 6 Months

date-fns

v4.1.0

Modern JavaScript date utility library

Weekly

34.9M

Monthly

189.4M

Growth

+17%

Bundle (gzip)

17.1 kB

dayjs

v1.11.20

2KB immutable date time library alternative to Moment.js with the same modern API

Weekly

26.9M

Monthly

148.5M

Growth

+19%

Bundle (gzip)

3.0 kB

luxon

v3.7.2

Immutable date wrapper

Weekly

15.9M

Monthly

88.3M

Growth

+22%

Bundle (gzip)

21.4 kB

Package Breakdown

date-fnsRecommended

Functional, tree-shakeable date utilities with excellent TypeScript support

✓ Best For

TypeScript projects, applications needing many date operations, and teams who prefer functional programming patterns

✗ Weakness

More verbose than Day.js for simple operations, no timezone support without date-fns-tz addon

dayjs

2kB Moment-compatible date library with a chainable API

✓ Best For

Bundle-size-critical applications, teams migrating from Moment.js, and simpler date formatting needs

✗ Weakness

Plugin system required for advanced features, less comprehensive TypeScript types than date-fns

luxon

Moment.js successor with first-class timezone and internationalization support

✓ Best For

Applications with complex timezone requirements, internationalization-heavy projects, and interval/duration calculations

✗ Weakness

Larger bundle than Day.js, not tree-shakeable, lower community adoption than date-fns

Should You Use date-fns?

date-fns is the right choice for most TypeScript projects that need more than basic date formatting. The type safety, tree-shakeability, and comprehensive function library make it the most production-hardened functional date library available.

If you need something lightweight and your use case is primarily formatting and simple date arithmetic — Day.js at 2kB is hard to argue with. If you have complex timezone requirements and internationalization needs — Luxon is purpose-built for that.

For the majority of applications — React dashboards, scheduling features, date pickers, reporting — date-fns hits the sweet spot of capability, type safety, and bundle efficiency.

Recommended: date-fns

Best TypeScript support, fully tree-shakeable, and the most comprehensive functional date API available.

Which to Use For Each Use Case

Use CaseWinner
TypeScript projectdate-fns
Migrating from Moment.jsdayjs
Complex timezone handlingluxon
Minimal bundle sizedayjs
Date picker componentdate-fns

FAQ

Does date-fns support timezones?+
Not natively — you need the date-fns-tz companion package for IANA timezone support. It adds parseFromTimeZone and formatInTimeZone functions that handle timezone-aware formatting and parsing. For complex timezone requirements, date-fns-tz is the standard addition.
Why are date-fns downloads so high?+
date-fns is a transitive dependency for many popular packages — date pickers, calendar components, form libraries, and scheduling tools all use it internally. A significant portion of its download count comes from projects that never explicitly installed it. That said, its direct adoption is also very high due to its TypeScript support and Moment.js migration recommendations.
Is date-fns v3 a breaking change from v2?+
date-fns v3 introduced ESM-first exports and changed some TypeScript types. The function API is largely compatible, but the import style changed — v3 uses named exports from the root package rather than deep imports. Most codebases can upgrade with a find-and-replace on import paths plus resolving any TypeScript type errors.
Will the Temporal API replace date-fns?+
The TC39 Temporal proposal aims to replace JavaScript's built-in Date object with a modern, timezone-aware API. When it ships in all browsers and Node.js (likely 2026-2027), it may reduce the need for date utility libraries for many use cases. date-fns would still have value for its formatting and locale functions, but arithmetic operations would be handled natively.

Related Comparisons

date-fns is one of the most downloaded JavaScript packages on npm — consistently ranking among the top utility libraries across the entire registry. Its approach is deceptively simple: instead of a date object with methods, every operation is a pure function that takes a date and returns a value. No mutation, full tree-shaking, and TypeScript types that are genuinely excellent.

Understanding date-fns download trends matters because it sits at an interesting inflection point: Moment.js is declining (sending downloads somewhere), the native Temporal API is on the horizon, and Day.js offers a lighter alternative. Where date-fns fits in that landscape is the question this page addresses.

Why date-fns Downloads Are So High

date-fns benefits from a compounding effect: it's the recommended alternative when developers migrate away from Moment.js, it's the default in many TypeScript project setups due to its type quality, and it's included as a dependency by popular libraries (date-pickers, calendar components, scheduling tools) — meaning its download count includes transitive installs from projects that never explicitly chose it.

The functional API — format(date, 'MM/dd/yyyy') rather than moment(date).format('MM/DD/YYYY') — aligns naturally with how modern JavaScript is written. Tree-shaking means a project using only format and addDays ships only those two functions, not the entire library.

Compared to Day.js, date-fns is larger when you use many functions but smaller when you use few (due to tree-shaking). Compared to Luxon (the other Moment.js successor, built by one of Moment's authors), date-fns has significantly more downloads and broader community adoption.

Compare Any Packages

Search any npm package and build your own custom comparison.

Open npm Trends Tool