lubridate (version 0.2.4)

yday: Get/set days component of a date-time.

Description

Get/set days component of a date-time.

Usage

yday(x)

Arguments

x
a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, or fts object.

Value

  • yday returns the day of the year as a decimal number (01-366). mday returns the day of the month as a decimal number (01-31).

Details

Date-time must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects.

See Also

wday

Examples

Run this code
x <- as.Date("2009-09-02")
yday(x) #245
mday(x) #2
yday(x) <- 1  #"2009-01-01"
yday(x) <- 366 #"2010-01-01"
mday(x) > 3

Run the code above in your browser using DataCamp Workspace