# Day.js

> Fast 2kB alternative to Moment.js with the same modern API

Source: https://talira.ai/catalog/day-js-evrthewv
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / dates and times](https://talira.ai/categories/libraries/dates-and-times), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Self-hostable: yes[^2]
- API: yes[^3]
- Plugins: yes[^4]
- Creator: iamkun

Day.js is a minimalist JavaScript library that parses, validates, manipulates and displays dates and times, with an API that is largely compatible with [Moment.js](https://talira.ai/catalog/moment-js-sv97zp5y.md) and a core of about 2 kB. Its objects are immutable and chainable, locales are loaded one at a time so only the languages you use reach your build, and anything beyond the core (custom parse formats, relative time, durations, ISO weeks, UTC and IANA time zones) comes from one of 35 official plugins added with `dayjs.extend`. It parses ISO 8601 strings by default; other formats take a format string and the CustomParseFormat plugin. iamkun created it in 2018, and a 2.0 is in alpha.

## Links

- Website: https://day.js.org
- GitHub: https://github.com/iamkun/dayjs
- Docs: https://day.js.org/docs/en/installation/installation

## Problems it solves

- Moment.js adds a big chunk to my JavaScript bundle just to format a few dates
- swap out Moment in a large codebase without rewriting every date call
- format a timestamp as YYYY-MM-DD in the browser with a tiny dependency
- add days or months to a date in JavaScript without changing the original object
- show '3 hours ago' style relative times in a web app
- convert a time into another IANA time zone like Asia/Taipei in the browser
- parse a date string in a custom format like DD/MM/YYYY in JavaScript
- load only the locale I need for formatted dates instead of shipping every language
- check whether a date is today, or falls between two other dates, in JS
- work with ISO week numbers and quarters for a JavaScript reporting dashboard

## Features

- Moment.js-style API: parse, format, get and set, add and subtract, startOf and endOf, isBefore and isSame
- immutable, chainable objects
- core of about 2 kB
- ISO 8601 parsing by default; custom formats with the CustomParseFormat plugin
- locales loaded on demand, per instance or globally
- 35 official plugins, including Timezone, UTC, RelativeTime, Duration, Calendar, IsoWeek, QuarterOfYear and AdvancedFormat
- IANA time zone conversion with dayjs.tz, tz.guess and tz.setDefault (Timezone plugin)
- TypeScript declarations in the package

## Capabilities

- Has an API: plan not known
- Takes plugins: plan not known

## Trust

Overall: 0.34 out of 1.
Signals: backing 0.20, extensibility 0.40.

- created by iamkun
- has a plugin system

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Moment.js](https://talira.ai/catalog/moment-js-sv97zp5y.md): Parse, validate, manipulate, and display dates in javascript.
- [date-fns](https://talira.ai/catalog/date-fns-w93szbbe.md): Modern JavaScript date utility library
- [Luxon](https://talira.ai/catalog/luxon-m1f352y5.md): A library for working with dates and times in JS

## Sources

[^1]: https://github.com/iamkun/dayjs/blob/dev/LICENSE (checked 20 Nov 2026)
[^2]: https://github.com/iamkun/dayjs (checked 20 Nov 2026)
[^3]: https://day.js.org/docs/en/parse/parse (checked 20 Nov 2026)
[^4]: https://day.js.org/docs/en/plugin/plugin (checked 20 Nov 2026)
