Date
Date Class

Description

Represents calendar dates.

Usage

## S3 method for class 'Date':
print(x, ...)

## S3 method for class 'Date': [(x, ..., drop = TRUE) ## S3 method for class 'Date': [(x, ...) <- value ## S3 method for class 'Date': [[(x, ..., drop = TRUE)

Arguments

x a Date object.
value any S object that can be converted to the Date class with as.Date(value), representing the replacement value for the relevant piece of the object.
drop a logical flag passed to the operators [ and [[, respectively. If TRUE (the default), specifies that the dimensions of length 0 or 1 should be dropped from the return object.
... additional arguments.

Details

An object of class Date is internally represented as structure(i, class = "Date"), where i is a numeric with positive values representing the number of days since the UNIX epoch: 1970-01-01 00:00:00 UTC. Negative values represent the earlier dates.
Value
print returns the original object x, with the invisible flag set to prevent reprinting.
[, [[, [<- returns a Date object formed by extracting or replacing the relevant subset.
References
http://en.wikipedia.org/wiki/Calendar_date.
See Also
as.Date, format.Date, julian.Date, Math.Date, Ops.Date, Summary.Date, POSIXt, Sys.Date.
Examples
## show the internal representation of the Date class
dput(Sys.Date())

## print some dates around the Unix epoch (x <- structure(-2:2, class = "Date"))

## replace the Unix epoch with the date ## triggering the Unix Millennium Bug x[3] <- "2038-01-19 03:14:08" x[2:4]

## subscripting x <- structure(matrix(1:6, 2), class = "Date") dput(x[1, ]) dput(x[1, , drop = FALSE])

Package base version 6.0.0-69
Package Index