tzDiff: Return difference between two time zones at a given date.

View source: R/RcppExports.R

tzDiffR Documentation

Return difference between two time zones at a given date.

Description

Difference between two given timezones at a specified date.

Usage

tzDiff(tzfrom, tzto, dt, verbose = FALSE)

Arguments

tzfrom

The first time zone as a character vector.

tzto

The second time zone as a character vector.

dt

A Datetime object specifying when the difference is to be computed.

verbose

A boolean toggle indicating whether more verbose operations are desired, default is FALSE.

Details

Time zone offsets vary by date, and this helper function computes the difference (in hours) between two time zones for a given date time.

Value

A numeric value with the difference (in hours) between the first and second time zone at the given date

Author(s)

Dirk Eddelbuettel

Examples

## Not run: 
# simple call: difference now
tzDiff("America/New_York", "Europe/London", Sys.time())
# tabulate difference for every week of the year
table(sapply(0:52, function(d) tzDiff("America/New_York", "Europe/London",
                                      as.POSIXct(as.Date("2016-01-01") + d*7))))

## End(Not run)

RcppCCTZ documentation built on Nov. 10, 2022, 5:52 p.m.