Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get_tz_list <- function() {
- big_list <- lapply(OlsonNames(), function(tz) {
- dates <- as.POSIXlt(seq(as.POSIXlt("2000-01-01 12:00:00", tz = tz),
- as.POSIXlt("2000-12-31 12:00:00", tz = tz),
- by = "1 day"))
- gmt_offset <- dates$gmtoff
- tz_code <- dates$zone
- is_dst <- c(NA, FALSE, TRUE)[dates$isdst + 2]
- gmt_offset[is.null(gmt_offset)] <- 0L
- tz_code[is.null(tz_code)] <- NA_character_
- # Possibly get start and end dates of DST?
- unique(data.frame(tz,
- tz_code,
- is_dst = is_dst,
- gmt_offset_h = gmt_offset / 3600,
- stringsAsFactors = FALSE))
- })
- do.call("rbind", big_list)
- }
Add Comment
Please, Sign In to add comment