\Header{weekdays}{Extract Parts of a POSIXt or Date Object}
\alias{julian}{weekdays}
\methalias{julian.Date}{weekdays}
\methalias{julian.POSIXt}{weekdays}
\alias{months}{weekdays}
\methalias{months.Date}{weekdays}
\methalias{months.POSIXt}{weekdays}
\alias{quarters}{weekdays}
\methalias{quarters.Date}{weekdays}
\methalias{quarters.POSIXt}{weekdays}
\methalias{weekdays.Date}{weekdays}
\methalias{weekdays.POSIXt}{weekdays}
\keyword{chron}{weekdays}
\begin{Description}\relax
Extract the weekday, month or quarter, or the Julian time
(days since some origin).  These are generic functions: the methods
for the internal date-time classes are documented here.
\end{Description}
\begin{Usage}
\begin{verbatim}
weekdays(x, abbreviate)
## S3 method for class 'POSIXt':
weekdays(x, abbreviate = FALSE)
## S3 method for class 'Date':
weekdays(x, abbreviate = FALSE)

months(x, abbreviate)
## S3 method for class 'POSIXt':
months(x, abbreviate = FALSE)
## S3 method for class 'Date':
months(x, abbreviate = FALSE)

quarters(x, abbreviate)
## S3 method for class 'POSIXt':
quarters(x, ...)
## S3 method for class 'Date':
quarters(x, ...)

julian(x, ...)
## S3 method for class 'POSIXt':
julian(x, origin = as.POSIXct("1970-01-01", tz="GMT"), ...)
## S3 method for class 'Date':
julian(x, origin = as.Date("1970-01-01"), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object inheriting from class \code{"POSIXt"} or \code{"Date"}.
\item[\code{abbreviate}] logical.  Should the names be abbreviated?
\item[\code{origin}] an length-one object inheriting from class
\code{"POSIXt"} or \code{"Date"}.
\item[\code{...}] arguments for other methods.
\end{ldescription}
\end{Arguments}
\begin{Value}
\code{weekdays} and \code{months} return a character
vector of names in the locale in use.

\code{quarters} returns a character vector of \code{"Q1"} to
\code{"Q4"}.

\code{julian} returns the number of days (possibly fractional)
since the origin, with the origin as a \code{"origin"} attribute.
\end{Value}
\begin{Note}\relax
Other components such as the day of the month or the year are
very easy to compute: just use \code{\Link{as.POSIXlt}} and extract
the relevant component.
\end{Note}
\begin{SeeAlso}\relax
\code{\Link{DateTimeClasses}}, \code{\Link{Date}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
weekdays(.leap.seconds)
months(.leap.seconds)
quarters(.leap.seconds)
\end{ExampleCode}
\end{Examples}

