Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timezone <- function()
- {
- time <- Sys.time()
- ret <- list(timezone=format(time, format="%Z"), UTC.offset=format(time, format="%z"))
- class(ret) <- "tzlookup"
- return(ret)
- }
- print.tzlookup <- function(x)
- {
- maxlen <- max(sapply(names(x), nchar))
- names <- gsub(names(x), pattern="_", replacement=" ")
- spacenames <- simplify2array(lapply(names, function(str) paste0(str, ":", paste0(rep(" ", maxlen-nchar(str)), collapse=""))))
- cat(paste(spacenames, x, sep=" ", collapse="\n"), "\n")
- invisible()
- }
- timezone()
- # timezone: EDT
- # UTC.offset: -0400
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement