On this page
Overview
date-fns is a utility library that works with native JavaScript Date values for formatting, comparison, arithmetic, intervals, and related date operations. It offers more than 200 modular functions, immutable pure-function semantics, TypeScript types, locales, and first-class time-zone support in v4.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use more than 200 date operations as modular functions
Formatting, comparisons, arithmetic, intervals, and related operations are exposed as separate functions that can be imported individually and tree-shaken.
Sources: [2]
Work with native Date values without extending global objects
The library accepts standard JavaScript Date values, avoids extending core objects, and returns new dates from immutable pure functions.
Sources: [2]
Best fit
Fits shared date formatting and business-date calculations in web and Node.js applications
It is useful for UI formatting, deadlines, interval comparison, locale-aware output, and other application date logic that benefits from small composable functions.
Sources: [2]
Before adoption
Define time-zone boundaries explicitly when using v4 time-zone support
v4 adds first-class time-zone support, but applications still need a clear policy for which zone represents input and output. Mixing local time and target-zone assumptions can produce unintended timestamps.
Sources: [2]
Do not start new CDN usage with the deprecated date-fns scripts
v4.4.0 deprecates CDN scripts shipped in the date-fns package and plans to remove them in the next major version. New CDN usage should move to the dedicated @date-fns/cdn package.
Sources: [3]
Official sources
- [1]date-fns/date-fns repository(2026-09-30)
- [2]date-fns README(2026-09-30)
- [3]date-fns v4.4.0 release(2026-09-30)
Supplemental curator note
Its modular API lets applications import only the date operations they need while keeping native Date values. In v4.4.0 the old bundled CDN scripts are deprecated, so existing CDN integrations should plan a migration.
Try it in 3 steps
- 1
Install date-fns
Add date-fns to a JavaScript or TypeScript project using the command from the README.
npm install date-fns --save - 2
Import only the date function you need
Use a named import for the required operation instead of loading unrelated date utilities.
import { format } from 'date-fns'; - 3
Format a native Date value
Verify the README example produces '2014-02-11' from a native JavaScript Date.
format(new Date(2014, 1, 11), 'yyyy-MM-dd');
Growth
Growth trends · Last 30 days
36,649 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 8
- Open PRs
- 359
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- javascript
- date
- modules
- utilities
- nodejs
- time
- date-fns
- hacktoberfest
- Stars
- 36,649
- Forks
- 2,020
- Watchers
- 205
- Open issues
- 669
- Contributors
- 395
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Sep 22, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Playwright96,842 Stars
3 shared tag(s) · 1 shared category(s) · Same language
Drive Chromium, Firefox, and WebKit through one API and test runner for E2E, scripting, and agent browser automation
TypeScript - Auth.js28,374 Stars
3 shared tag(s) · Same language
Compose OAuth/OIDC, passwordless, WebAuthn, and stateless or database-backed sessions from packages built around standard Web APIs
TypeScript - Mermaid90,482 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Generate flowcharts, sequences, classes, ER diagrams, Gantt charts, and more from text syntax
TypeScript - Tolgee4,117 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Bring real application context into translation management, AI, and MCP workflows
TypeScript - Storybook91,174 Stars
2 shared tag(s) · 1 shared category(s) · Same language
capture UI states once and reuse them across docs, interaction tests, and agent tooling
TypeScript - Vite83,069 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Combine a native-ESM dev server and HMR with Rolldown-powered production builds
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.