Date-time must be a POSIXct, POSIXlt, Date, Period, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects.
month(x, label = FALSE, abbr = TRUE, locale = Sys.getlocale("LC_TIME")) month(x) <- value
a date-time object
logical. TRUE will display the month as a character string such as "January." FALSE will display the month as a number.
logical. FALSE will display the month as a character string label, such as "January". TRUE will display an abbreviated version of the label, such as "Jan". abbr is disregarded if label = FALSE.
for month, locale to use for month names. Default to current locale.
a numeric object
the months element of x as a number (1-12) or character string. 1 = January.
x <- ymd("2012-03-26") month(x)#>  3month(x) <- 1 month(x) <- 13 month(x) > 3#>  FALSEmonth(ymd(080101))#>  1month(ymd(080101), label = TRUE)#>  Jan #> 12 Levels: Jan < Feb < Mar < Apr < May < Jun < Jul < Aug < Sep < ... < Decmonth(ymd(080101), label = TRUE, abbr = FALSE)#>  January #> 12 Levels: January < February < March < April < May < June < ... < December#>  Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 12 Levels: Jan < Feb < Mar < Apr < May < Jun < Jul < Aug < Sep < ... < Dec