A tolerant detector: recognizes a calendar date or datetime in essentially
any plausible written form (ISO, US, European, named-month, with or without
time, 12/24-hour, T-separated, offsets, fractional seconds, weekday
prefixes) by trying a library of strptime formats. Non-dates – counts,
ZIPs, phones, ids, free text – are rejected by the in-range + round-trip
guard.
See also
Other datetime detectors:
is_abbr_month_date(),
is_clock_time(),
is_date_range(),
is_day_of_week(),
is_fiscal_year(),
is_hijri_date(),
is_iso_date(),
is_iso_datetime(),
is_long_date(),
is_month_day(),
is_month_of_year(),
is_month_year(),
is_quarter(),
is_rfc2822_datetime(),
is_us_date(),
is_us_datetime(),
is_yyyymm()
Examples
is_date(c("2016-03-15", "05/Mar/2016", "March 5, 2016 2:00 PM",
"20160305T14:00:00Z", "banana", "12345"))
#> [1] TRUE TRUE TRUE TRUE FALSE FALSE