This method gives the output in object form containing year, month, day-of-month, hour, minute, seconds, milliseconds.
moment().toObject();
var a = moment().toObject(); var objstr = a.years + " " + a.months + " " + a.date + " " + a.hours + " " + a.minutes + " " + a.seconds;