Skip to contents

Cast an object to a timespan

Usage

as.timespan(x, ..., format = parse_iso8601_datetime_as_timespan)

Arguments

x

an object to cast

...

Additional arguments passed to format when a function is provided.

format

a function or character value. If a function, it should accept a character vector and return a matrix of parttime components. If a character it should provide a regular exprssion which contains capture groups for each of the parttime components. See parse_to_parttime_matrix's regex parameter for more details.

Value

A partial_time object. See the Details section of timespan

for more information.