MomentJS Tutorial
MomentJS Useful Resources
Selected Reading
- MomentJS - Examples
- MomentJS - Plugins
- MomentJS - Utilities
- MomentJS - Durations
- MomentJS - Customization
- MomentJS - Internationalization
- MomentJS - Date Queries
- Formatting Date And Time
- Manipulate Date And Time
- MomentJS - Getter/Setter
- MomentJS - Date Validation
- MomentJS - Parsing Date And Time
- MomentJS - Introduction
- MomentJS - Environment Setup
- MomentJS - Overview
- MomentJS - Home
MomentJS Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MomentJS - Parsing Date And Time
MomentJS - Parsing Date and Time
MomentJS has many easy to use methods which helps in parsing Date and Time. It can parse dates in the form of object, string, array, JavaScript native date object etc. This chapter discusses them in detail.
Parsing Date
MomentJS gives wrapper object as output when moment() is called. You can observe the following when you console the output in the browser.
MomentJS provides various methods to parse the Date as psted below −
Sr.No. | Method & Syntax |
---|---|
1 | moment() |
2 | moment(string) |
3 | moment(object) |
4 | moment(Date) |
5 | moment(Array[]) |
6 | moment(number) |
7 | moment(Moment) |
8 | moment.utc() |
9 | moment.parseZone() |
10 | moment().creationData(); |
11 | var m = moment({hour: 3, minute: 40, seconds: 10}); |