Calculate Time Between Two Dates
time_between.Rd
Calculate the elapsed time between two dates in a specified unit of time. Order of dates within does not necessarily matter, but order will dictate sign of returned output.
Usage
time_between(date2, date1, unit = c("days", "weeks", "months", "years"))
Examples
date2 = as.POSIXlt("2023-02-08 00:10:00 PST")
date1 = as.POSIXlt("1986-01-08 22:00:00 PST")
time_between(date2, date1, unit = "days")
#> [1] 13544