Moment.js 2.22.0 - Parse, validate, manipulate, and display dates and times in JavaScript.
| # | Moment | Result |
|---|---|---|
| 1 | moment().format('dddd, MMMM[ын] Do YYYY, h:mm:ss a') | |
| 2 | moment().format('dddd') | |
| 3 | moment().format("MMM Do YY") | |
| 4 | moment().format('YYYY оны MMMMын D') | |
| 5 | moment().format() | |
| 6 | moment("20111031", "YYYYMMDD").fromNow() | |
| 7 | moment("20120620", "YYYYMMDD").fromNow() | |
| 8 | moment().startOf('day').fromNow() | |
| 9 | moment().endOf('day').fromNow() | |
| 10 | moment().startOf('hour').fromNow() | |
| 11 | moment().subtract(10, 'days').calendar() | |
| 12 | moment().subtract(6, 'days').calendar() | |
| 13 | moment().subtract(3, 'days').calendar() | |
| 14 | moment().subtract(1, 'days').calendar() | |
| 15 | moment().calendar() | |
| 16 | moment().add(1, 'days').calendar() | |
| 17 | moment().add(3, 'days').calendar() | |
| 18 | moment().add(10, 'days').calendar() | |
| 19 | moment().format('LT') | |
| 20 | moment().format('LTS') | |
| 21 | moment().format('L') | |
| 22 | moment().format('l') | |
| 23 | moment().format('LL') | |
| 24 | moment().format('ll') | |
| 25 | moment().format('LLL') | |
| 26 | moment().format('lll') | |
| 27 | moment().format('LLLL') | |
| 28 | moment().format('llll') |