getFormat: Get date format from character text

View source: R/date_format.R

getFormatR Documentation

Get date format from character text

Description

Get the POSIX standard date formats from character text formats.

Usage

getFormat(
  date,
  char.format = c("MM.DD.YYYY", "MMM.DD.YYYY", "DD.MM.YYYY", "DD.MMM.YYYY", "YYYY.MM.DD",
    "YYYY.MMM.DD"),
  sep = ""
)

Arguments

date

character string of date

char.format

character text format of date

sep

character string separating date

Value

A character string representing the POSIX standard date format equivalent of the string in char.format.

Author(s)

Derek Chiu

See Also

Other date formatting functions: chr_to_date(), cleanDate(), formatDate(), numericToDate()

Examples

getFormat("12/09/1993", "MM.DD.YYYY")
getFormat("2005-09-13", "YYYY.MM.DD")

TalhoukLab/biostatUtil documentation built on April 14, 2025, 4:15 a.m.