format.clock_zoned_time | R Documentation |
This is a zoned-time method for the format()
generic.
This function allows you to format a zoned-time using a flexible format
string.
If format
is NULL
, a default format of "%Y-%m-%dT%H:%M:%S%Ez[%Z]"
is
used. This matches the default format that zoned_time_parse_complete()
parses. Additionally, this format matches the de-facto standard extension to
RFC 3339 for creating completely unambiguous date-times.
## S3 method for class 'clock_zoned_time'
format(x, ..., format = NULL, locale = clock_locale(), abbreviate_zone = FALSE)
x |
A zoned-time. |
... |
Not used, but no error will be thrown if not empty to remain compatible
with usage of the |
format |
If Otherwise, a format string which is a combination of: Year
Month
Day
Day of the week
ISO 8601 week-based year
Week of the year
Day of the year
Date
Time of day
Time zone
Miscellaneous
|
locale |
A locale object created from |
abbreviate_zone |
If If |
A character vector of the formatted input.
x <- year_month_day(2019, 1, 1)
x <- as_zoned_time(as_naive_time(x), "America/New_York")
format(x)
format(x, format = "%B %d, %Y")
format(x, format = "%B %d, %Y", locale = clock_locale("fr"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.