date_format | R Documentation |
date_format()
formats a date (Date) or date-time (POSIXct/POSIXlt) using
a format
string.
There are separate help pages for formatting dates and date-times:
dates (Date)
date-times (POSIXct/POSIXlt)
date_format(x, ...)
x |
A date or date-time vector. |
... |
These dots are for future extensions and must be empty. |
A character vector of the formatted input.
# See method specific documentation for more examples
x <- as.Date("2019-01-01")
date_format(x, format = "year: %Y, month: %m, day: %d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.