ISOdatetime: Construct Date-time Objects¶
Description¶
ISOdate and ISOdatetime construct date-time objects from numeric representations. Sys.time returns current time.
Usage¶
ISOdatetime(
year,
month,
day,
hour,
min,
sec,
tz = "",
lenient = FALSE,
locale = NULL
)
ISOdate(
year,
month,
day,
hour = 0L,
min = 0L,
sec = 0L,
tz = "",
lenient = FALSE,
locale = NULL
)
Sys.time()
Arguments¶
|
numeric vectors |
|
|
|
single logical value; should date/time parsing be lenient? |
|
|
Value¶
These functions return an object of class POSIXxt, which extends upon POSIXct, strptime.
You might wish to consider calling as.Date on the result yielded by ISOdate.
No attributes are preserved (because they are too many).
Differences from Base R¶
Replacements for base ISOdatetime and ISOdate implemented with stri_datetime_create.
ISOdatedoes not treat dates as being at midnight by default [fixed here]
See Also¶
The official online manual of stringx at https://stringx.gagolewski.com/
Related function(s): strptime
Examples¶
ISOdate(1970, 1, 1)
## [1] "1970-01-01T00:00:00+0100"
ISOdatetime(1970, 1, 1, 12, 0, 0)
## [1] "1970-01-01T12:00:00+0100"