dateToDaysOld function

convert date to age in days

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.

Returns

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

Examples

dateToDaysOld("23aug2007")

See Also

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

  • Maintainer: James M. Ward
  • License: MIT + file LICENSE
  • Last published: 2025-03-23