This function constructs date-time objects from numeric representations.
stri_datetime_create(year, month, day, hour = 12L, minute = 0L,
second = 0, lenient = FALSE, tz = NULL, locale = NULL)
integer vector; 0 is 1BC, -1 is 2BC, etc.
integer vector; months are 1-based
integer vector
integer vector
integer vector
numeric vector; fractional seconds are allowed
single logical value; should the operation be lenient?
NULL
or ""
for the default time zone or
a single string with time zone identifier, see stri_timezone_list
NULL
or ""
for default locale,
or a single string with locale identifier; a non-Gregorian calendar
may be specified by setting @calendar=name
keyword
Returns an object of class POSIXct
.
Vectorized over year
, month
, hour
,
hour
, minute
, and second
.
Other datetime: stri_datetime_add
,
stri_datetime_fields
,
stri_datetime_format
,
stri_datetime_fstr
,
stri_datetime_now
,
stri_datetime_symbols
,
stri_timezone_get
,
stri_timezone_info
,
stri_timezone_list
# NOT RUN {
stri_datetime_create(2015, 12, 31, 23, 59, 59.999)
stri_datetime_create(5775, 8, 1, locale="@calendar=hebrew") # 1 Nisan 5775 -> 2015-03-21
stri_datetime_create(2015, 02, 29)
stri_datetime_create(2015, 02, 29, lenient=TRUE)
# }
Run the code above in your browser using DataLab