File: stri_timezone_set.Rd

package info (click to toggle)
r-cran-stringi 1.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 30,632 kB
  • sloc: cpp: 301,844; perl: 471; makefile: 9; sh: 1
file content (73 lines) | stat: -rw-r--r-- 2,296 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/time_zone.R
\name{stri_timezone_get}
\alias{stri_timezone_get}
\alias{stri_timezone_set}
\title{Set or Get Default Time Zone in \pkg{stringi}}
\usage{
stri_timezone_get()

stri_timezone_set(tz)
}
\arguments{
\item{tz}{single string; time zone identifier}
}
\value{
\code{stri_timezone_set} returns a string with
previously used timezone, invisibly.

\code{stri_timezone_get} returns a single string
with the current default time zone.
}
\description{
\code{stri_timezone_set} changes the current default time zone for all functions
in the \pkg{stringi} package, i.e., establishes the meaning of the
``\code{NULL} time zone'' argument to date/time processing functions.

\code{stri_timezone_get} gets the current default time zone.

For more information on time zone representation in \pkg{ICU}
and \pkg{stringi}, refer to \code{\link{stri_timezone_list}}.
}
\details{
Unless the default time zone has already been set using
\code{stri_timezone_set}, the default time zone is determined
by querying the OS with methods in \pkg{ICU}'s internal platform utilities.
}
\examples{
\dontrun{
oldtz <- stri_timezone_set('Europe/Warsaw')
# ... many time zone-dependent operations
stri_timezone_set(oldtz) # restore previous default time zone
}

}
\references{
\emph{TimeZone} class -- ICU API Documentation,
\url{https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1TimeZone.html}
}
\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_create}()},
\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_info}()},
\code{\link{stri_timezone_list}()}

Other timezone: 
\code{\link{stri_timezone_info}()},
\code{\link{stri_timezone_list}()}
}
\concept{datetime}
\concept{timezone}
\author{
\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors
}