Gets the time difference in secs, minutes, hours, days or weeks. Uses difftime() but floors x and y first after coercing to POSIXct and adjusts the timezone of y to match that of x.
dtt_diff(x, y, units = "secs", as_difftime = FALSE)
An object that can be coerced to a POSIXct using dtt_date_time().
An object that can be coerced to a POSIXct using dtt_date_time().
A string of the time units. The possible values are "secs", "minutes", "hours", "days" or "weeks".
A flag specifying whether to return a difftime vector.
A numeric vector of the time difference.