types.castDate: Cast date

View source: R/types.castDate.R

types.castDateR Documentation

Cast date

Description

Cast date without a time.

Usage

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

Arguments

format

Available options are "default", "any", and "<pattern>", where:

default

An ISO8601 format string:

date:

This MUST be in ISO8601 format YYYY-MM-DD.

datetime:

A date-time. This MUST be in ISO 8601 format YYYY-MM-DDThh:mm:ssZ in UTC time.

time:

A time without a date.

any

Any parsable representation of the type. The implementing library may attempt to parse the datetime using various strategies, e.g., lubridate, parsedate, strptime, or DateTimeClasses.

<pattern>

Date/time values in this field can be parsed according to the specified pattern. <pattern> MUST follow the syntax of strptime. That is, values in this field should be parseable by R using the given pattern.

value

Date to cast.

See Also

Types and formats specifications, strptime, DateTimeClasses, parsedate-package, lubridate-package.

Examples

types.castDate(format = "default", value =  as.Date("2019-1-1"))

types.castDate(format = "default", value = "2019-1-1")

types.castDate(format = "any", value = "2019-1-1")

types.castDate(format = "%d/%m/%y", value = "21/11/06")

types.castDate(format = "%d/%m/%y", value = as.Date("2019-1-1"))


frictionlessdata/tableschema-r documentation built on April 13, 2025, 3:51 p.m.