Skip to content

[Superseded]

These functions are kept for backward compatibility; you should switch to [label_date()/label_time() for new code.

Usage

date_format(format = "%Y-%m-%d", tz = "UTC", locale = NULL)

time_format(format = "%H:%M:%S", tz = "UTC", locale = NULL)

Arguments

format

For date_format() and time_format() a date/time format string using standard POSIX specification. See strptime() for details.

For date_short() a character vector of length 4 giving the format components to use for year, month, day, and hour respectively.

tz

a time zone name, see timezones(). Defaults to UTC

locale

Locale to use when for day and month names. The default uses the current locale. Setting this argument requires stringi, and you can see a complete list of supported locales with stringi::stri_locale_list().