Skip to contents

Is it an ISO 8601 datetime?

Usage

is_iso_datetime(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for YYYY-MM-DDThh:mm:ss with optional fractional seconds and Z/offset zone.

Examples

is_iso_datetime(c("2009-06-15T13:45:30+02:00", "2009-06-15", NA))
#> [1]  TRUE FALSE    NA