using moment.js to capture current time and date code example
Example 1: moment js from now
moment(date).fromNow();
Example 2: how to get current time using moment
var startDate = moment().subtract(1, 'days'); //one day before the current time
moment(date).fromNow();
var startDate = moment().subtract(1, 'days'); //one day before the current time