convert date to age in days

dateToDaysOld(testDate, nowDate = Sys.Date(), units = "days", ...)

Arguments

testDate

character date recognized by asDate(), representing the test date.

nowDate

character date recognized by asDate(), representing the reference date, by default the current day.

units

character indicating the units, as used by difftime().

...

additional parameters are ignored.

Value

integer value with the number of calendar days before the current date, or the nowDate if supplied.

See also

Other jam date functions: asDate(), getDate()

Examples

dateToDaysOld("23aug2007")
#> [1] 5831