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.
Official sources
- [1]iamkun/dayjs repository metadata(2026-10-04)
- [2]Day.js v1.11.23 README(2026-10-04)
- [3]Day.js v1.11.23 release(2026-10-04)
- [4]Day.js v1.11.23 package.json(2026-10-04)
- [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
Create a small evaluation project
Keep the trial separate from an existing application.
mkdir dayjs-demo && cd dayjs-demo && npm init -y - 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
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'))"
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Prettier52,314 Stars
2 shared tag(s) · 1 shared category(s) · Same language
an opinionated formatter that parses code and reprints a consistent style
JavaScript - Tesseract.js38,752 Stars
2 shared tag(s) · 1 shared category(s) · Same language
run OCR for images in 100+ languages from browsers and Node.js
JavaScript - Fastify37,227 Stars
2 shared tag(s) · 1 shared category(s) · Same language
build Node.js web and API servers with low overhead, plugins, JSON Schema validation, and Pino logging
JavaScript - ESLint27,531 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Use AST analysis and pluggable rules to turn JavaScript quality checks into repository policy through flat config
JavaScript - i18next8,637 Stars
2 shared tag(s) · 1 shared category(s) · Same language
keep translation keys, plurals, interpolation, and resource loading independent of the UI framework
JavaScript - np7,710 Stars
2 shared tag(s) · 1 shared category(s) · Same language
an interactive release CLI that checks branch, Git state, tests, 2FA, and dist-tags before npm publishing
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.