OSS Tanbou

format, compare, and calculate JavaScript dates with small pure functions

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
36,649
Primary language
TypeScript
License
MIT
Repository last updated
Sep 22, 2026
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. [1]date-fns/date-fns repository(2026-09-30)
  2. [2]date-fns README(2026-09-30)
  3. [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. 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. 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. 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');
Check the official README

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

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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?