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

tzDiff {RcppCCTZ} | R 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)

[Package RcppCCTZ version 0.2.9 Index]