Skip to content

Month - Built-in Date & Time Function

Purpose

Month returns the month from a datetime expression.

Syntax

Month(datetime)

Arguments

Argument Required Description
datetime Yes Any valid datetime expression from which the month will be returned

Returns

Integer

See also

Example

// returns the month (2) of the year
Return Month("3 february 2010")
// returns the month of the order date
Return Month({orderhea.order_date})
// returns the month (2) of the constructed date via DateSerial
Return Month(DateSerial(2000,2,3))
// returns the month of the static date string
Return Month("02/03/2000")

Notes

  • When date cannot be converted to a datetime value, a runtime error is generated.
  • When date is passed as a string, your PC's regional settings are used for the conversion to datetime. If that fails—e.g., the month name is not in the right language—you get a runtime error.