Dear Rxperts, Was wondering if there is any function in R similar to options("time.zone"): found in S-Plus that can help in looking at the default timezone settings.. Thanks much, Santosh [ [[alternative HTML version deleted]]
On 03.10.2012 20:00, Santosh wrote:> Dear Rxperts, > Was wondering if there is any function in R similar to > options("time.zone"): found in S-Plus that can help in looking at the > default timezone settings..Sys.timezone() Uwe Ligges> > Thanks much, > Santosh > [ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Sys.time() Regarding changing time zones you may want to search for POSIXct Best Regards, Bhupendrasinh Thakre Sent from my iPhone On Oct 3, 2012, at 1:00 PM, Santosh <santosh2005 at gmail.com> wrote:> Dear Rxperts, > Was wondering if there is any function in R similar to > options("time.zone"): found in S-Plus that can help in looking at the > default timezone settings.. > > Thanks much, > Santosh > [ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On Oct 3, 2012, at 11:00 AM, Santosh wrote:> Dear Rxperts, > Was wondering if there is any function in R similar to > options("time.zone"): found in S-Plus that can help in looking at the > default timezone settings..Many of us have no way to understand questions based on analogies with S. Are you asking how to see the current TZ?> attr(as.POSIXlt(Sys.time()), "tzone" )[1] "" "PST" "PDT" Your timezone is handled by your OS (and the printed output is handled by print.POSIXct, which has options for converting to other TZs). From the timezones help page: "Note that except on Windows, the operation of time zones is an OS service, and even on Windows a third-party database is used and can be updated (see the section on ?Time zone names?)." Or are you asking where to find the range of possible values? This is the first example in the help page for ?timezones zfile <- "/usr/share/zoneinfo/zone.tab" tzones <- read.delim(tzfile, row.names = NULL, header = FALSE, col.names = c("country", "coords", "name", "comments"), as.is = TRUE, fill = TRUE, comment.char = "#") str(tzones$name) chr [1:410] "Europe/Andorra" "Asia/Dubai" "Asia/Kabul" "America/Antigua" "America/Anguilla" ... -- David Winsemius, MD Alameda, CA, USA