moment get now time code example
Example 1: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 2: 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');
Example 3: how to get current time using moment
var startDate = moment().subtract(1, 'days');
Example 4: moment.js get time from now
moment("20111031", "YYYYMMDD").fromNow();
moment("20120620", "YYYYMMDD").fromNow();
moment().startOf('day').fromNow();
moment().endOf('day').fromNow();
moment().startOf('hour').fromNow();