dttm_diff | R Documentation |
Computation of the difference between two dates (date2 - date1 + add).
dttm_diff(
date1,
date2,
add = 0,
unit = c("days", "secs", "mins", "hours", "weeks")
)
date1 |
A date single value |
date2 |
A date single value |
add |
A numeric single value (default = 0) |
unit |
A character single value with the unit of the date result (secs, mins, hours, days, weeks) |
A numeric single value with the computed difference between the two dates.
date1 <- lubridate::dmy("01/05/1998")
date2 <- lubridate::dmy("21/11/2018")
dttm_diff(date1 = date1,date2 = date2,unit = "days")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.