Skip to contents

Excel with US localization will automatically convert dates from year-month-day to month/day/year. Thus whenever a date is read from a CSV that might have been edited with Excel I'm going to check for slashes and assume month/day/year if they are present.

Usage

format_csv_date_time(x, format = "datetime")

Arguments

x

Date times as character month/day/year h:m or year-month-day h:m can be mixed in one vector. h:m:s is also acceptable in place of h:m

Value

Dates as year-month-day (character)

Examples

# example code
if (FALSE) { # \dontrun{
x <- c(NA, "2024-05-15", "2024-05-16", "5/16/2024")
} # }