moment now date code example
Example 1: javascript get time ago with moment
const dateTimeAgo = moment("2020-04-04 11:45:26.123").fromNow();
console.log(dateTimeAgo);
Example 2: moment to date
moment().toDate();
Example 3: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 4: moment now format
var date = moment().format('MM/DD/YYYY');
Example 5: moment js from now
moment(date).fromNow();
Example 6: moment js get french time 20:00:00
moment().format();
moment().format("dddd, MMMM Do YYYY, h:mm:ss a");
moment().format("ddd, hA");
moment('gibberish').format('YYYY MM DD');