demo 1
demo 2
demo 3
moment().format('MM-DD-YY'); // "08-13-19"
moment().format('MM-DD-YYYY'); // "08-13-2019"
moment().format('MM/DD/YYYY'); // "08/13/2019"
moment().format('MMM Do, YYYY') // "Aug 13th, 2019"
moment().format('ddd MMMM Do, YYYY HH:mm:ss') // "Tues August 13th, 2019 19:29:20"
moment().format('dddd, MMMM Do, YYYY -- hh:mm:ss A') // "Tuesday, August 13th, 2019 -- 07:31:02 PM"
moment().format('dddd, MMMM Do, YYYY -- hh:mm:ss a') // "Tuesday, August 13th, 2019 -- 07:31:02 pm"
moment().format('dddd [the] Do [of] MMMM') // "Friday the 16th of May"
Date"
moment().format('d') // "0..6-Weekday"
moment().format('dd') // "Su"
moment().format('ddd') // "Sun "
moment().format('dddd') // "Sunday"
moment().format('YY') // "13-Year"
moment().format('YYYY') // "2013"
moment().format('M') // "1..12 (Jan is 1)-Month"
moment().format('Mo') // "1st..12th"
moment().format('MM') // "01..12 (Jan is 1)"
moment().format('MMM') // "Jan"
moment().format('MMMM') // "January"
moment().format('Q') // "1..4-Quarter"
moment().format('Qo') // "1st..4th"
moment().format('D') // "1..31 Day"
moment().format('Do') // "1st..31st"
moment().format('DD') // "01..31"
moment().format('DDD') // "1..365-Day of year"
moment().format('DDDo') // "1st..365th"
moment().format('DDDD') // "001..365"
moment().format('w') // "1..53 Week of year"
moment().format('wo') // "1st..53rd"
moment().format('ww') // "01..53"
Time"
moment().format('H') // "0..23-24h hour"
moment().format('HH') // "00..23"
moment().format('h') // "1..12-12h hour"
moment().format('hh') // "01..12"
moment().format('m') // "0..59-Minutes"
moment().format('mm') // "00..59"
moment().format('s') // "0..59-Seconds"
moment().format('ss') // "00..59"
moment().format('a') // "am-AM/PM"
moment().format('A') // "AM"
moment().format('Z') // "+07:00-Timezone offset"
moment().format('ZZ') // "+0730 "
moment().format('S') // "0..9-Deciseconds"
moment().format('SS') // "00..99-Centiseconds"
moment().format('SSS') // "000..999-Milliseconds"
moment().format('X') // "Unix timestamp"
moment().format('x') // "Millisecond-Unix timestamp"
Presets"
moment().format('LT') // "8:30 PM"
moment().format('LTS') // "8:30:25 PM"
moment().format('LL') // "August 2 1985"
moment().format('ll') // "Aug 2 1985"
moment().format('LLL') // "August 2 1985 08:30 PM"
moment().format('lll') // "Aug 2 1985 08:30 PM"
moment().format('LLLLvThursday, August 2 1985 08:30 PM"
moment().format('llll') // "Thu, Aug 2 1985 08:30 PM"
Moment | Result |
Moment | Result |
Moment | Result |
Moment | Result |