Skip to contents

Warn if the vector contains unknown datetime format such as "2003-12-15T-:15:18", "2003-12-15T13:-:19","--12-15","-----T07:15"

Usage

warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))

Arguments

dtc

a character vector containing the dates

is_valid

a logical vector indicating whether elements in dtc are valid

Value

No return value, called for side effects

See also

Function that provide users with custom warnings suppress_warning(), warn_if_incomplete_dtc(), warn_if_inconsistent_list(), warn_if_vars_exist()

Examples


## No warning as `dtc` is a valid date format
warn_if_invalid_dtc(dtc = "2021-04-06")

## Issues a warning
warn_if_invalid_dtc(dtc = "2021-04-06T-:30:30")