- 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 - Month
This method gets/sets the month. The range is from 0-11, if greater it will show the next year, if negative it will show the last year.
Syntax
moment().month(Number|String); moment().month();
Example
var m = moment().month(); var d = moment().month(8); var a = moment().month("November"); var k = moment().month(20); var o = moment().month(-5);
Output
momentjs_getter_setter.htm
Advertisements