Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

format_ISO8601

Format in ISO8601 character format


Description

Format in ISO8601 character format

Usage

format_ISO8601(x, usetz = FALSE, precision = NULL, ...)

Arguments

x

An object to convert to ISO8601 character format.

usetz

Include the time zone in the formatting (of outputs including time; date outputs never include time zone information).

precision

The amount of precision to represent with substrings of "ymdhms", as "y"ear, "m"onth, "d"ay, "h"our, "m"inute, and "s"econd. (e.g. "ymdhm" would show precision through minutes. When NULL, full precision for the object is shown.

...

Additional arguments to methods.

Value

A character vector of ISO8601-formatted text.

References

Examples

format_ISO8601(as.Date("02-01-2018", format="%m-%d-%Y"))
format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz="EST"), usetz=TRUE)
format_ISO8601(as.POSIXct("2018-02-01 03:04:05", tz="EST"), precision="ymdhm")

lubridate

Make Dealing with Dates a Little Easier

v1.7.10
GPL (>= 2)
Authors
Vitalie Spinu [aut, cre], Garrett Grolemund [aut], Hadley Wickham [aut], Ian Lyttle [ctb], Imanuel Costigan [ctb], Jason Law [ctb], Doug Mitarotonda [ctb], Joseph Larmarange [ctb], Jonathan Boiser [ctb], Chel Hee Lee [ctb], Google Inc. [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.