Press "Enter" to skip to content

A Lightweight Date & Time Manipulation JavaScript Library | dayjs

dayjs is a blazing-fast,  ultra-light (2kb) various to the second.js library that helps you parse, validate, manipulate, and show dates and instances in pure JavaScript.

Install & Import:

$ npm install dayjs --save

Import the day’s library into your challenge.

<!-- Node.js -->
var dayjs = require('dayjs');
<!-- Typescript -->
import * as dayjs from 'dayjs'
<!-- Browser -->
<script src="[email protected]/dayjs.min.js"></script>

Import locals. You can discover all locals right here.

<!-- Browser --> 
<script src="[email protected]/locale/de.js"></script>

Import plugins if want. All attainable plugins:

  • SuperiorFormat
  • BuddhistEra
  • Calendar
  • CustomParseFormat
  • DayOfYear
  • Duration
  • IsBetween
  • IsLeapYear
  • IsSameOrAfter
  • IsSameOrBefore
  • IsToday
  • IsTomorrow
  • IsYesterday
  • IsoWeek
  • IsoWeeksInYear
  • LocaleData
  • LocalizedFormat
  • MinMax
  • QuarterOfYear
  • RelativeTime
  • ToArray
  • ToObject
  • UpdateLocale
  • UTC
  • WeekDay
  • weekOfYear
  • WeekYear
var PlugiName = require('dayjs/plugin/pluginname')
<!-- Browser -->
<script src="[email protected]/plugin/pluginname.js"></script>


All the API are much like the Moment.js, simply change the ‘moment’ with ‘dayjs’ as follows. You can discover the full API right here.

// parse

// show
dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A')

// get & set
dayjs().set('month', 3).month() 

// manipulate
dayjs().add(1, 'year') 

// query

// set local

Date & Time Manipulation Library, dayjs Github, Day.js Plugin

See Demo And Download

Official Website(iamkun): Click Here

This superior jQuery/javascript plugin is developed by iamkun. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *