Skip to contents

Create a parttime object

Usage

parttime(
  year = NA,
  month = NA,
  day = NA,
  hour = NA,
  min = NA,
  sec = NA,
  tzhour = interpret_tz(getOption("parttime.assume_tz_offset", NA))/60
)

Arguments

year

numeric vector to use for partial time year component

month

numeric vector to use for partial time month component

day

numeric vector to use for partial time day component

hour

numeric vector to use for partial time hour component

min

numeric vector to use for partial time min component

sec

numeric vector to use for partial time sec component

tzhour

numeric vector to use for partial time tzhour component

Value

A partial_time object. See Details section for further information.

Details

A parttime object (short for its class name, partial_time), is a vector representation of a numeric matrix containing rows for each vector element and a column for each datetime field.

To inspect the internal representation of a partial_time class vector, you can use vctrs::field(<pttm>, "pttm_mat").

Examples

parttime(2019)
#> <partial_time<YMDhms+tz>[1]> 
#> [1] "2019"