Month Procedure

Returns the month component of a date.

Overload #1: Month(date)

Declaration
function Month(date as Date) as Number

Parameters

Return value

Number — The month component of the date.

Example

Code
dim x = DateFromParts(2021, 3, 12)
print Month(x)
Output
3

Overload #2: Month(dateTime)

Declaration
function Month(dateTime as DateTime) as Number

Parameters

Return value

Number — The month component of the date.

Example

Code
dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 59, 488)
print Month(x)
Output
3

Overload #3: Month(dateTimeOffset)

Declaration
function Month(dateTimeOffset as DateTimeOffset) as Number

Parameters

Return value

Number — The month component of the date.

Example

Code
dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Months(-4))
print Month(x)
Output
3