Skip to contents

Create a timespan duration

Usage

timespan(x)

Arguments

x

chr/POSIXt/Date

  • chr One of year, season, quarter, month, week, day, hour

  • POSIXt/Date/Datetime A Date or Datetime vector

Value

Duration See duration

Examples

timespan(seq(Sys.time() - lubridate::dyears(), Sys.time(), by = 1))
#> [1] "31557600s (~1 years)"
timespan("season")
#> [1] "7889400s (~13.04 weeks)"