
Formatting of date
format_date(date_format = "%d%b%Y")
a function
converting a date into string
.
(string
) the output format.
format_date("%d%b%Y")(as.Date("2021-01-01"))
if ("NZ" %in% OlsonNames()) {
format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "NZ"))
}
if ("US/Pacific" %in% OlsonNames()) {
format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "US/Pacific"))
}
Run the code above in your browser using DataLab