View source: R/parsedate-package.r
parse_iso_8601 | R Documentation |
See https://en.wikipedia.org/wiki/ISO_8601 and links therein for the complete standard.
parse_iso_8601(dates, default_tz = "UTC")
dates |
A character vector. An error is reported if the function cannot coerce this parameter to a character vector. |
default_tz |
Time zone to assume for dates that don't specify a time zone explicitly. Defaults to UTC, and an empty string means the local time zone. |
A POSIXct
vector. NA
is returned for
the dates that parse_date
could not parse.
# Missing fields parse_iso_8601("2013-02-08 09") parse_iso_8601("2013-02-08 09:30") # Separator between date and time can be a 'T' parse_iso_8601("2013-02-08T09") parse_iso_8601("2013-02-08T09:30") parse_iso_8601("2013-02-08T09:30:26") # Fractional seconds, minutes, hours parse_iso_8601("2013-02-08T09:30:26.123") parse_iso_8601("2013-02-08T09:30.5") parse_iso_8601("2013-02-08T09,25") # Zulu time zone is UTC parse_iso_8601("2013-02-08T09:30:26Z") # ISO weeks, not very intuitive parse_iso_8601("2013-W06-5") parse_iso_8601("2013-W01-1") parse_iso_8601("2009-W01-1") parse_iso_8601("2009-W53-7") # Day of the year parse_iso_8601("2013-039") parse_iso_8601("2013-039 09:30:26Z")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.