% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/time_calendar.R
\name{stri_datetime_create}
\alias{stri_datetime_create}
\title{Create a Date-Time Object}
\usage{
stri_datetime_create(
  year = NULL,
  month = NULL,
  day = NULL,
  hour = 0L,
  minute = 0L,
  second = 0,
  lenient = FALSE,
  tz = NULL,
  locale = NULL
)
}
\arguments{
\item{year}{integer vector; 0 is 1BCE, -1 is 2BCE, etc.;
\code{NULL} for the current year}

\item{month}{integer vector; months are 1-based;
\code{NULL} for the current month}

\item{day}{integer vector;
\code{NULL} for the current day}

\item{hour}{integer vector;
\code{NULL} for the current hour}

\item{minute}{integer vector;
\code{NULL} for the current minute}

\item{second}{numeric vector; fractional seconds are allowed;
\code{NULL} for the current seconds (without milliseconds)}

\item{lenient}{single logical value; should the operation be lenient?}

\item{tz}{\code{NULL} or \code{''} for the default time zone or
a single string with time zone identifier, see \code{\link{stri_timezone_list}}}

\item{locale}{\code{NULL} or \code{''} for default locale,
or a single string with locale identifier; a non-Gregorian calendar
may be specified by setting \code{@calendar=name} keyword}
}
\value{
Returns an object of class \code{\link{POSIXct}}.
}
\description{
Constructs date-time objects from numeric representations.
}
\details{
Vectorized over \code{year}, \code{month}, \code{day}, \code{hour},
\code{hour}, \code{minute}, and \code{second}.
}
\examples{
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)
stri_datetime_create(hour=15, minute=59)

}
\seealso{
The official online manual of \pkg{stringi} at \url{https://stringi.gagolewski.com/}

Gagolewski M., \pkg{stringi}: Fast and portable character string processing in R, \emph{Journal of Statistical Software} 103(2), 2022, 1-59, \doi{10.18637/jss.v103.i02}

Other datetime: 
\code{\link{stri_datetime_add}()},
\code{\link{stri_datetime_fields}()},
\code{\link{stri_datetime_format}()},
\code{\link{stri_datetime_fstr}()},
\code{\link{stri_datetime_now}()},
\code{\link{stri_datetime_symbols}()},
\code{\link{stri_timezone_get}()},
\code{\link{stri_timezone_info}()},
\code{\link{stri_timezone_list}()}
}
\concept{datetime}
\author{
\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors
}
