date_time_build | R Documentation |
date_time_build()
builds a POSIXct from it's individual components.
To build a POSIXct, it is required that you specify the zone
.
date_time_build(
year,
month = 1L,
day = 1L,
hour = 0L,
minute = 0L,
second = 0L,
...,
zone,
invalid = NULL,
nonexistent = NULL,
ambiguous = NULL
)
year |
The year. Values |
month |
The month. Values |
day |
The day of the month. Values If |
hour |
The hour. Values |
minute |
The minute. Values |
second |
The second. Values |
... |
These dots are for future extensions and must be empty. |
zone |
A valid time zone name. This argument is required, and must be specified by name. |
invalid |
One of the following invalid date resolution strategies:
Using either If If |
nonexistent |
One of the following nonexistent time resolution strategies, allowed to be either length 1, or the same length as the input:
Using either If If |
ambiguous |
One of the following ambiguous time resolution strategies, allowed to be either length 1, or the same length as the input:
Alternatively, Finally, If If |
Components are recycled against each other using tidyverse recycling rules.
A POSIXct.
# The zone argument is required!
# clock always requires you to be explicit about your choice of `zone`.
try(date_time_build(2020))
date_time_build(2020, zone = "America/New_York")
# Nonexistent time due to daylight saving time gap from 01:59:59 -> 03:00:00
try(date_time_build(1970, 4, 26, 1:12, 30, zone = "America/New_York"))
# Resolve with a nonexistent time resolution strategy
date_time_build(
1970, 4, 26, 1:12, 30,
zone = "America/New_York",
nonexistent = "roll-forward"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.