View source: R/transforms_time.R
iso_to_posix | R Documentation |
Convert an ISO8601 date/time to POSIXct
iso_to_posix(dtc, .time, .tz = "UTC", .day, .month)
dtc |
A ISO8601 formatted date/time |
.time |
If dtc is date-only, a time to use as an offset. If length is not 1 or same as dtc, .time is recycled with a warning. |
.tz |
The timezone for the dtc values. Default is UTC. |
.day |
If dtc is year-month only, a month to use a default. If length is not 1 or same as dtc, .time is recycled with a warning. |
.month |
If dtc is year only, a month to use a default. If length is not 1 or same as dtc, .time is recycled with a warning. |
The conversion does its best to guess at the format of the time and to fill in any missing parts, defaulting to Jan, the first of the month, and midnight. The default day, month, and time can be provided, but it's important to note that the infill of these values won't cross more than one division. That is, "1990" will default to "1990-01-01 00:00", even if .time is given as 06:35. The missing pieces must be filled in in order.
date/time as R POSIXct native type.
iso_to_posix("2016-10-03T21:22:45")
iso_to_posix(c("2016-10-03","2016-10-03T12:34"),"09:00")
iso_to_posix(c("2016-10-03","2016-10-03","2016-10-03"), c("09:00", "10:10")) #gives a warning about length of .times
iso_to_posix(c("1980", "1980-06", "1980-06-15"), .time="09:34")
iso_to_posix(c("1980", "1980-06", "1980-06-15"), .time="09:34", .day=15, .month=6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.