moment js create a date code example
Example 1: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 2: date format in moment js
moment().format('MMMM Do YYYY, h:mm:ss a'); // April 14th 2021, 5:38:08 pm
moment().format('dddd'); // Wednesday
moment().format("MMM Do YY"); // Apr 14th 21
moment().format('YYYY [escaped] YYYY'); // 2021 escaped 2021
moment().format(); // 2021-04-14T17:38:08+06:00
Example 3: moment to javascript date
let now = moment()
let now = now.toDate()