Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
npm install dayjs
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
47,968 Stars
1,559 Commits
2,369 Forks
278 Watchers
9 Branches
331 Contributors
Updated on Jul 12, 2025
Latest Version
1.11.13
Package Id
dayjs@1.11.13
Unpacked Size
654.57 kB
Size
141.71 kB
File Count
451
NPM Version
10.8.1
Node Version
20.16.0
Published on
Aug 20, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
29
English | 简体中文 | 日本語 | Português Brasileiro | 한국어 | Español (España) | Русский | Türkçe | සිංහල | עברית
Fast 2kB alternative to Moment.js with the same modern API
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
1dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
You can find more details, API, and other docs on day.js.org website.
1npm install dayjs --save
It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.
1dayjs('2018-08-08') // parse 2 3dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display 4 5dayjs().set('month', 3).month() // get & set 6 7dayjs().add(1, 'year') // manipulate 8 9dayjs().isBefore(dayjs()) // query
Day.js has great support for internationalization.
But none of them will be included in your build unless you use it.
1import 'dayjs/locale/es' // load on demand 2 3dayjs.locale('es') // use Spanish locale globally 4 5dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance
A plugin is an independent module that can be added to Day.js to extend functionality or add new features.
1import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand 2 3dayjs.extend(advancedFormat) // use plugin 4 5dayjs().format('Q Do k kk X x') // more available formats
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
[Become a sponsor via Github] [Become a sponsor via OpenCollective]
This project exists thanks to all the people who contribute.
Please give us a 💖 star 💖 to support us. Thank you.
And thank you to all our backers! 🙏
Day.js is licensed under a MIT License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More