Render ordinal dates in UK or US style
Arguments
- date_to_format
The date to use. It must be either be of class
Dateor a string written as "YYYY-MM-DD" or "YYYY/MM/DD". Can be a vector (e.g. a column indplyr::mutate()); missing dates stay missing.- uk_or_us
Defaults to "UK", which results in outputs like "12th September 2022"; if "US", the output resembles "September 12th, 2022".
- formal_or_informal
Defaults to "informal", so the ordinals are included (e.g. "st", "nd", "rd", "th"). If "formal" is chosen, the ordinals are omitted (e.g. "12 September 2022").
Value
A string (e.g. "12th September 2022"), or a character vector the
same length as date_to_format
See also
Other verbaliseR functions:
listify(),
num_to_text(),
pluralise(),
restore_capitals()
