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 of YYYY-MM-DDThh:mm:ssZ in UTC time

  • time: a time without a date

any

Any parsable representation of the type. The implementing library can attempt to parse the datetime via a range of strategies, e.g. lubridate, parsedate,strptime, DateTimeClasses.

<pattern>

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

value

date to cast

See Also

Types and formats specifications, strptime, DateTimeClasses, parsedate-package and 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"))


tableschema.r documentation built on Sept. 30, 2022, 1:06 a.m.