File: stri_datetime_create.Rd

package info (click to toggle)
r-cran-stringi 1.8.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 30,636 kB
  • sloc: cpp: 301,879; perl: 471; makefile: 9; sh: 1
file content (84 lines) | stat: -rw-r--r-- 2,523 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
% 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
}