This help topic is for R version 1.5.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/weekday.POSIXt.html
weekdays {base}R Documentation

Extract Parts of a POSIXt Object

Description

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.

Usage

## S3 method for class 'POSIXt'
weekdays(x, abbreviate = FALSE)
## S3 method for class 'POSIXt'
months(x, abbreviate = FALSE)
## S3 method for class 'POSIXt'
quarters(x, ...)
## S3 method for class 'POSIXt'
julian(x, origin = as.POSIXct("1970-01-01", tz="GMT"), ...)

Arguments

x

an object inheriting from class "POSIXt".

abbreviate

logical. Should the names be abbreviated?

origin

an length-one object inheriting from class "POSIXt".

...

arguments for other methods.

Value

weekdays and months return a character vector of names in the locale in use.

quarters returns a character vector of "Q1" to "Q4".

julian returns the number of days (possibly fractional) since the origin, with the origin as a "origin" attribute.

Note

Other components such as the day of the month or the year are very easy to compute: just use as.POSIXlt and extract the relevant component.

See Also

DateTimeClasses

Examples

weekdays(.leap.seconds)
months(.leap.seconds)
quarters(.leap.seconds)

[Package base version 1.5.0 ]