File: local_time.Rd

package info (click to toggle)
r-cran-lubridate 1.7.4-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,952 kB
  • sloc: cpp: 3,329; ansic: 714; sh: 22; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (4)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/time-zones.r
\name{local_time}
\alias{local_time}
\title{Get local time from a date-time vector.}
\usage{
local_time(dt, tz = NULL, units = "secs")
}
\arguments{
\item{dt}{a date-time object.}

\item{tz}{a character vector of timezones for which to compute the local time.}

\item{units}{passed directly to \code{\link[=as.difftime]{as.difftime()}}.}
}
\description{
\code{local_time} retrieves day clock time in specified time zones. Computation is
vectorized over both \code{dt} and \code{tz} arguments, the shortest is recycled in
accordance with standard R rules.
}
\examples{

x <- ymd_hms(c("2009-08-07 01:02:03", "2009-08-07 10:20:30"))
local_time(x, units = "secs")
local_time(x, units = "hours")
local_time(x, "Europe/Amsterdam")
local_time(x, "Europe/Amsterdam") == local_time(with_tz(x, "Europe/Amsterdam"))

x <- ymd_hms("2009-08-07 01:02:03")
local_time(x, c("America/New_York", "Europe/Amsterdam", "Asia/Shanghai"), unit = "hours")
}