formatDate | R Documentation |
Prints a date into a pretty format.
formatDate(
d,
m,
y,
date.format = c("MM.DD.YYYY", "MMM.DD.YYYY", "DD.MM.YYYY", "DD.MMM.YYYY", "YYYY.MM.DD",
"YYYY.MMM.DD"),
sep = "/"
)
d |
day of the month (1-31) |
m |
month of the year (1-12) |
y |
year of date |
date.format |
how to format the date. Defaults to "month/day/year". |
sep |
string used to separate |
Given the day, month, and year of a date, returns the date in a specific
format. The order and separating string can be modified using
date.format
and sep
respectively. Take note the order of the
arguments: day, month, and year. Only accepts "MM.DD.YYYY", "MMM.DD.YYYY",
"DD.MM.YYYY", "DD.MMM.YYYY", "YYYY.MM.DD", "YYYY.MMM.DD".
A character string of a formatted date.
Samuel Leung, Derek Chiu
Other date formatting functions:
chr_to_date()
,
cleanDate()
,
getFormat()
,
numericToDate()
formatDate(8, 7, 2011)
formatDate(8, 7, 2011, date.format = "YYYY.MM.DD")
formatDate(8, 7, 2011, date.format = "DD.MM.YYYY", sep = "-")
formatDate(10, 1, 2015, date.format = "MMM.DD.YYYY", sep = "-")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.