as.interval changes difftime, Duration, Period and numeric class objects to
intervals that begin at the specified date-time. Numeric objects are first
coerced to timespans equal to the numeric value in seconds.

as.interval(x, start, ...)

## Arguments

x |
a duration, difftime, period, or numeric object that describes the length of the interval |

start |
a POSIXt or Date object that describes when the interval begins |

... |
additional arguments to pass to as.interval |

## Value

an interval object

## Details

as.interval can be used to create accurate transformations between Period
objects, which measure time spans in variable length units, and Duration objects,
which measure timespans as an exact number of seconds. A start date-
time must be supplied to make the conversion. Lubridate uses
this start date to look up how many seconds each variable
length unit (e.g. month, year) lasted for during the time span
described. See
`as.duration()`

, `as.period()`

.

## See also

`interval()`

## Examples

#> [1] 2009-01-01 UTC--2009-02-01 UTC

#> [1] 2009-02-01 UTC--2009-03-04 UTC

#> [1] 2009-01-01 UTC--2009-02-01 UTC

#> [1] 2009-02-01 UTC--2009-03-04 UTC

#> [1] 2009-01-01 UTC--2009-02-01 UTC

#> [1] 2009-02-01 UTC--2009-03-01 UTC

#> [1] 2009-01-01 UTC--2018-11-10 UTC