monthofyear()
Learn how to use the monthofyear() function to get the integer representation of the month.
Returns the integer number from 1-12 representing the month number of the given year.
Syntax
monthofyear(date)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | datetime | ✔️ | The date for which to find the month number. |
Returns
An integer from 1-12 representing the month number of the given year.
Example
print result=monthofyear(datetime("2015-12-14"))
Output
| result |
|---|
| 12 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.