A very fast method of adding time units to dates and date-times.
time_add(
x,
timespan,
roll_month = getOption("timeplyr.roll_month", "xlast"),
roll_dst = getOption("timeplyr.roll_dst", c("NA", "xfirst"))
)time_subtract(
x,
timespan,
roll_month = getOption("timeplyr.roll_month", "xlast"),
roll_dst = getOption("timeplyr.roll_dst", c("NA", "xfirst"))
)
time_floor(x, timespan, week_start = getOption("lubridate.week.start", 1))
time_ceiling(
x,
timespan,
week_start = getOption("lubridate.week.start", 1),
change_on_boundary = is_date(x)
)
A date, date-time, or other time-based vector.
Time vector.
E.g. a Date
, POSIXt
, numeric
or any time-based vector.
timespan.
See ?timechange::time_add
. Additional choices
include xlast
(default) and xfirst
. These work conceptually similar to
skipped DST intervals.
See ?timechange::time_add
.
day on which week starts following ISO conventions - 1
means Monday, 7 means Sunday (default). When label = TRUE
,
this will be the first level of the returned factor.
You can set lubridate.week.start
option to control this parameter globally.
?timechange::time_floor
The methods are continuously being improved over time. Date arithmetic should be very fast regardless of the timespan supplied. Date-time arithmetic, specifically when supplied days, weeks, months and years, is being improved.