% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/accessors-month.r
\name{month}
\alias{month}
\alias{month<-}
\title{Get/set months component of a date-time}
\usage{
month(x, label = FALSE, abbr = TRUE, locale = Sys.getlocale("LC_TIME"))

month(x) <- value
}
\arguments{
\item{x}{a date-time object}

\item{label}{logical. TRUE will display the month as a character string such
as "January." FALSE will display the month as a number.}

\item{abbr}{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.}

\item{locale}{for month, locale to use for month names. Default to current locale.}

\item{value}{a numeric object}
}
\value{
If \code{label = FALSE}: month as number (1-12, 1 = January, 12 = December),
otherwise as an ordered factor.
}
\description{
Date-time must be a POSIXct, POSIXlt, Date, Period, chron, yearmon, yearqtr, zoo,
zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects.
}
\examples{
x <- ymd("2012-03-26")
month(x)
month(x) <- 1
month(x) <- 13
month(x) > 3

month(ymd(080101))
month(ymd(080101), label = TRUE)
month(ymd(080101), label = TRUE, abbr = FALSE)
month(ymd(080101) + months(0:11), label = TRUE)
}
\keyword{chron}
\keyword{manip}
\keyword{methods}
\keyword{utilities}
