month() function

Extract the month part from a date, or the number of months from a Interval

Syntax

month(date)
month(Interval)

Arguments

date - is date or datetime. The date to extract the month from.
Interval - is Interval. The Interval to return the number of months from.

Example

month('2012-05-12') → 05
month(tointerval('3 months')) → 3
month(age('2012-01-01','2010-01-01')) → 4.033...