OSS TanbouSign in with GitHub

Parse, format, and manipulate dates with a small immutable JavaScript library and a familiar Moment.js-style API

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
48,665
Primary language
JavaScript
License
MIT
Repository last updated
Sep 15, 2026
On this page

Overview

Day.js is a JavaScript library for parsing, validating, manipulating, and formatting dates in browsers and Node.js. It packages a chainable, largely Moment.js-compatible API into a roughly 2 kB immutable core. Locales and features such as advanced formats or time-zone handling can be loaded only when they are needed.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Use a familiar Moment.js-style API without mutating the original value

Values created with dayjs() support chained methods such as format, set, add, and isBefore. Each operation returns a new value, reducing the risk that a shared date object is modified unexpectedly by another part of an application.

Sources: [2]

Load locales and extended behavior only where they are required

The core does not bundle every feature. Projects import the locales and plugins they need, such as advanced formatting, allowing basic date display to remain small while additional behavior is introduced deliberately.

Sources: [2]

Best fit

Fits browser code that wants a smaller dependency while retaining familiar date APIs

Day.js suits web applications that format, compare, or calculate dates on the client and teams evaluating a migration from Moment.js without immediately rewriting every call pattern. Selective locale and plugin loading is useful when frontend bundle size matters.

Sources: [2]

Before adoption

Test time zones, strict parsing, and mutability assumptions before migration

The project describes its API as largely Moment.js-compatible, not identical in every edge case. Time zones, UTC behavior, durations, strict parsing, and boundary values need tests with the required plugins. Day.js is immutable, so code that depends on Moment.js mutating an existing value must be updated to use returned values. Release v1.11.23 includes a timezone-plugin fix for invalid Day.js values.

Sources: [2][3]

Official sources

  1. [1]iamkun/dayjs repository metadata(2026-10-04)
  2. [2]Day.js v1.11.23 README(2026-10-04)
  3. [3]Day.js v1.11.23 release(2026-10-04)
  4. [4]Day.js v1.11.23 package.json(2026-10-04)
  5. [5]Day.js v1.11.23 MIT license(2026-10-04)
Supplemental curator note

Do not choose a replacement on bundle size alone; test the actual formats, time zones, and daylight-saving boundaries used by the application. The key migration question is whether code that relied on Moment.js mutability can consistently consume returned values instead.

Try it in 3 steps

  1. 1

    Create a small evaluation project

    Keep the trial separate from an existing application.

    mkdir dayjs-demo && cd dayjs-demo && npm init -y
  2. 2

    Install the reviewed stable release

    Follow the README npm installation while pinning the release used for this guide.

    npm install dayjs@1.11.23
  3. 3

    Check date manipulation and formatting

    Use the immutable chained API to add one day and confirm that it prints 2026-10-05.

    node -e "const dayjs=require('dayjs'); console.log(dayjs('2026-10-04').add(1,'day').format('YYYY-MM-DD'))"
Check the official README

Growth

Growth trends · Last 30 days

48,665 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
4
Open PRs
377

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • time
  • date
  • date-formatting
  • datetime
  • moment
  • dayjs
Stars
48,665
Forks
4,067
Watchers
283
Open issues
977
Contributors
358
Owner type
User
Primary language
JavaScript
License
MIT
Repository last updated
Sep 15, 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?