MomentJS - En tant qu'objet

Cette méthode donne la sortie sous forme d'objet contenant année, mois, jour du mois, heure, minute, secondes, millisecondes.

Syntaxe

moment().toObject();

Exemple

var a = moment().toObject();
var objstr = a.years + " " + a.months + " " + a.date + " " + a.hours + " " + a.minutes + " " + a.seconds;

Production