MomentJS - Object



Moment can take the date, time units in object form as shown below −

Syntax

moment({unit: value, ...});

Example

var day = moment({ year :2017, month :10, day :3, hour :15, minute :10, second :3, millisecond :123});

Output

String Objects
momentjs_parsing_date_and_time.htm
Advertisements