MCPcopy Create free account
hub / github.com/date-fns/date-fns

github.com/date-fns/date-fns

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.1.0 ↗ · + Follow · compare 2 versions
1,203 symbols 3,735 edges 1,539 files ⚖ MIT 0 documented · 0% updated 23d agov5.0.0-alpha.0 · 2026-05-29★ 36,645665 open issues

Browse by type

Functions 888 Types & classes 315
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔥️ NEW: date-fns v4.0 with first-class time zone support is out!

date-fns

date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js

👉 Documentation

👉 Blog


It's like Lodash for dates

  • It has 200+ functions for all occasions.
  • Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
  • Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
  • Immutable & Pure: Built using pure functions and always returns a new date instance.
  • TypeScript: The library is 100% TypeScript with brand-new handcrafted types.
  • I18n: Dozens of locales. Include only what you need.
  • and many more benefits
import { compareAsc, format } from "date-fns";

format(new Date(2014, 1, 11), "yyyy-MM-dd");
//=> '2014-02-11'

const dates = [
  new Date(1995, 6, 2),
  new Date(1987, 1, 11),
  new Date(1989, 6, 10),
];
dates.sort(compareAsc);
//=> [
//   Wed Feb 11 1987 00:00:00,
//   Mon Jul 10 1989 00:00:00,
//   Sun Jul 02 1995 00:00:00
// ]

The library is available as an npm package. To install the package run:

npm install date-fns --save

Docs

See date-fns.org for more details, API, and other docs.

License

MIT © Sasha Koss

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 792
Interface 241
Method 96
Class 74

Languages

TypeScript100%

Modules by API surface

src/parseISO/index.ts19 symbols
src/types.ts14 symbols
src/locale/types.ts13 symbols
scripts/release/buildChangelog.ts13 symbols
src/parse/_lib/Setter.ts11 symbols
src/parse/_lib/utils.ts9 symbols
src/_lib/format/lightFormatters/index.ts9 symbols
src/locale/fi/_lib/formatDistance/index.ts8 symbols
test/dst/tzOffsetTransitions.ts7 symbols
src/parse/_lib/parsers/YearParser.ts7 symbols
src/locale/sk/_lib/formatDistance/index.ts7 symbols
src/parse/_lib/parsers/StandAloneMonthParser.ts6 symbols

Dependencies from manifests, versioned

@arethetypeswrong/cli0.16.2 · 1×
@babel/cli7.22.10 · 1×
@babel/core7.22.10 · 1×
@babel/preset-env7.22.10 · 1×
@babel/preset-typescript7.22.5 · 1×
@date-fns/docs0.38.0 · 1×
@date-fns/tz1.0.2 · 1×
@date-fns/utc1.2.0 · 1×
@octokit/core3.2.5 · 1×
@rollup/plugin-commonjs25.0.4 · 1×
@rollup/plugin-node-resolve15.2.1 · 1×
@rollup/plugin-terser0.4.4 · 1×

For agents

$ claude mcp add date-fns \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page