types.castDuration: Cast duration of time

View source: R/types.castDuration.R

types.castDurationR Documentation

Cast duration of time

Description

Cast duration of time

Usage

types.castDuration(format = "default", value)

Arguments

format

no options (other than the default)

value

duration to cast

Details

We follow the definition of XML Schema duration datatype directly and that definition is implicitly inlined here.

To summarize: the lexical representation for duration is the ISO 8601 extended format PnYnMnDTnHnMnS, where nY represents the number of years, nM the number of months, nD the number of days, 'T' is the date/time separator, nH the number of hours, nM the number of minutes and nS the number of seconds. The number of seconds can include decimal digits to arbitrary precision. Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omitted for reduced precision.

See Also

Types and formats specifications, lubridate-package.

Examples


types.castDuration(format = "default", value = durations(years= 10))

types.castDuration(format = "default", value = "P1Y10M3DT5H11M7S")
 

frictionlessdata/tableschema-r documentation built on Oct. 1, 2022, 11:44 a.m.