diff --git a/R/dtc_create_iso8601.R b/R/dtc_create_iso8601.R index ededaa4d..34981d44 100644 --- a/R/dtc_create_iso8601.R +++ b/R/dtc_create_iso8601.R @@ -389,6 +389,11 @@ format_iso8601 <- function(m, .cutoff_2000 = 68L) { #' format <- list(c("dd mmm yyyy", "dd mmm yyyyHH:MM")) #' create_iso8601(datetimes, .format = format, .na = c("UN", "UNK")) #' +#' # Dates and times may come in many format variations +#' fmt <- "dd MMM yyyy HH nn ss" +#' fmt_cmp <- fmt_cmp(mon = "MMM", min = "nn", sec = "ss") +#' create_iso8601("05 feb 1985 12 55 02", .format = fmt, .fmt_c = fmt_cmp) +#' #' @export create_iso8601 <- function(..., .format, .fmt_c = fmt_cmp(), .na = NULL, .cutoff_2000 = 68L, .check_format = FALSE) { diff --git a/man/create_iso8601.Rd b/man/create_iso8601.Rd index e55adf17..81481975 100644 --- a/man/create_iso8601.Rd +++ b/man/create_iso8601.Rd @@ -93,4 +93,9 @@ datetimes <- c("UN UNK 201914:00", "UN JAN 2021") format <- list(c("dd mmm yyyy", "dd mmm yyyyHH:MM")) create_iso8601(datetimes, .format = format, .na = c("UN", "UNK")) +# Dates and times may come in many format variations +fmt <- "dd MMM yyyy HH nn ss" +fmt_cmp <- fmt_cmp(mon = "MMM", min = "nn", sec = "ss") +create_iso8601("05 feb 1985 12 55 02", .format = fmt, .fmt_c = fmt_cmp) + }