AdvancedFormat
AdvancedFormat extends dayjs().format API to supply more format options.
var advancedFormat = require("dayjs/plugin/advancedFormat");
// import advancedFormat from 'dayjs/plugin/advancedFormat' // ES 2015
dayjs.extend(advancedFormat);
dayjs().format("Q Do k kk X x");
Note: some of the format options like z and zzz in the table below require additional plugins.
List of added formats:
| Format | Output | Description | 
|---|---|---|
| Q | 1-4 | Quarter | 
| Do | 1st 2nd ... 31st | Day of Month with ordinal | 
| k | 1-24 | The hour, beginning at 1 | 
| kk | 01-24 | The hour, 2-digits, beginning at 1 | 
| X | 1360013296 | Unix Timestamp in second | 
| x | 1360013296123 | Unix Timestamp in millisecond | 
| w | 1 2 ... 52 53 | Week of year (
    dependent WeekOfYearplugin
    ) | 
| ww | 01 02 ... 52 53 | Week of year, 2-digits (
    dependent WeekOfYearplugin
    ) | 
| W | 1 2 ... 52 53 | ISO Week of year (
    dependent IsoWeekplugin
    ) | 
| WW | 01 02 ... 52 53 | ISO Week of year, 2-digits (
    dependent IsoWeekplugin
    ) | 
| wo | 1st 2nd ... 52nd 53rd | Week of year with ordinal (
    dependent WeekOfYearplugin
    ) | 
| gggg | 2017 | Week Year (
    dependent WeekYearplugin
    ) | 
| GGGG | 2017 | ISO Week Year (
    dependent IsoWeekplugin
    ) | 
| z | EST | Abbreviated named offset (
    dependent Timezoneplugin
    ) | 
| zzz | Eastern Standard Time | Unabbreviated named offset (
    dependent Timezoneplugin
    ) | 
