MONTH

The MONTH function returns the month of a date as an integer from 1 (corresponding to January) to 12 (corresponding to December).

Syntax

MONTH(
    date
)

Parameters
  • date: Value corresponding to a date in datetime format, or text representing a date.
Returned value

The MONTH function returns an integer in the range [1,12].

Additional Information

Even though the MONTH function requires a datetime type argument, it can receive as an argument a real number (in which the integer part is considered as a reference to the date and the decimal part as a reference to the time), with general or any other format. format (date and time or other). For this reason, the MONTH function takes both a time and a date as an argument. In the case of receiving an hour as an argument (without reference to a specific date), the date of December 30, 1899 is assumed. Thus, the function:

MONTH("15:13:43")

...will return 12 (corresponding to December).

The date argument can be provided by a date/time creation function, by a function that returns a date/time value, by a reference to a column containing date/time values, or as a text string containing the value of date/time from which to extract the data sought. In the latter case, the MONTH function will use the regional configuration and the date and time settings of the client computer in order to interpret the text from which to extract the correct value. In this way, the following functions (which receive the same real number as an argument with a different format), will return the same value: 10.

MONTH("10/15/2016 11:9:14")

MONTH(42658.4230787037)

However, the interpretation of a date such as "8/10/2016" will depend on your locale. If it represents dates in "day/month/year" format, it will be interpreted as August 10, 2016. On the contrary, if it represents dates in "month/day/year" format, it will be interpreted as October 8 of 2016.

The value returned by this function will always be the one corresponding to the Gregorian calendar. More information about this calendar can be found on Wikipedia.

Examples

The following example extracts the month from the field that contains the date and time of each sale:

MONTH function: Example of use

Related functions
Category
Date and time
Submitted by admin on Tue, 12/04/2018 - 00:09