Interval objects represent a range of time and can be created using %--% from the lubridate package.
as_interval() makes this 'pipe friendly', allowing you to create an Interval object from a vector of 2 dates, datetimes, or characters
(formatted as "YYYY-MM-DD HH:MM:SS" UTC time or "now" for the current time).
Arguments
- date_range
(Optional - required if
startandendare not provided). A vector of 2 dates, datetimes, or characters (formatted as "YYYY-MM-DD HH:MM:SS" UTC time or "now" for the current time) representing the start and end time period. NA values will be replaced with 1970-01-01 or "now" for the first and second values, respectively.- start
(Optional - required if
date_rangeis not provided). A date, datetime, or character (formatted as "YYYY-MM-DD HH:MM:SS" UTC time or "now" for the current time) representing the start of the date range.- end
(Optional - required if
date_rangeis not provided). A date, datetime, or character (formatted as "YYYY-MM-DD HH:MM:SS" UTC time or "now" for the current time) representing the end of the date range.