- MomentJS Tutorial
- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
- MomentJS Useful Resources
- MomentJS - Quick Guide
- MomentJS - Useful Resources
- MomentJS - Discussion
MomentJS - As Object
This method gives the output in object form containing year, month, day-of-month, hour, minute, seconds, milliseconds.
Syntax
moment().toObject();
Example
var a = moment().toObject(); var objstr = a.years + " " + a.months + " " + a.date + " " + a.hours + " " + a.minutes + " " + a.seconds;
Output
momentjs_formatting_date_and_time.htm
Advertisements