Dates: Date Class

Description of the class "Date" representing calendar dates.

Usage

# S3 method for Date summary(object, digits = 12, …) 

# S3 method for Date print(x, max = NULL, …)

Arguments

a Date object to be summarized or printed.

number of significant digits for the computations.

numeric or NULL , specifying the maximal number of entries to be printed. By default, when NULL , getOption("max.print") used.

further arguments to be passed from or to other methods.

Details

Dates are represented as the number of days since 1970-01-01, with negative values for earlier dates. They are always printed following the rules of the current Gregorian calendar, even though that calendar was not in use long ago (it was adopted in 1752 in Great Britain and its colonies).

It is intended that the date should be an integer, but this is not enforced in the internal representation. Fractional days will be ignored when printing. It is possible to produce fractional days via the mean method or by adding or subtracting (see Ops.Date ).

From the many methods, see methods(class = "Date") , a few are documented separately, see below.

See Also

Sys.Date for the current date.

weekdays for convenience extraction functions.

Methods with extra arguments and documentation:

for operators on "Date" objects.

for conversion to and from character strings.

and hist.Date for plotting.

, cut.Date , and round.Date for utility operations.

Examples

# NOT RUN (today format(today, "%d %b %Y") # with month as a word (tenweeks 10, by="1 week")) # next ten weeks weekdays(today) months(tenweeks) # > # NOT RUN  # > # NOT RUN < (Dls ) ) # > 

Run the code above in your browser using DataLab