getMonth()
Table of Contents
Overview
The getMonth() function takes a dateTimeValue as an argument, and returns the numerical value of the month.
Return Type
- Number
 
Syntax
<variable> = <dateTimeValue>.getMonth();
(OR)
<variable> = getMonth( <dateTimeValue>);
(OR)
<variable> = <dateTimeValue>.month();
(OR)
<variable> = month( <dateTimeValue>);
| Parameter | Description | Data type | 
|---|---|---|
| <variable> | Variable which will contain the returned number. | NUMBER | 
| <dateTimeValue> | The date-time value from which the month's numerical value will be returned. A runtime error will be encountered if: 
 The function returns a null value if: 
 Refer this help document to learn about the supported date-time formats.  | DATE-TIME | 
Examples
currentDate = '08-Jan-2019';
monthNumber = currentDate.getMonth(); // returns 1
monthNumber = currentDate.getMonth(); // returns 1