tzDiff | R Documentation |
Difference between two given timezones at a specified date.
tzDiff(tzfrom, tzto, dt, verbose = FALSE)
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 |
Time zone offsets vary by date, and this helper function computes the difference (in hours) between two time zones for a given date time.
A numeric value with the difference (in hours) between the first and second time zone at the given date
Dirk Eddelbuettel
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.