R 4.3.1 OS X Colleagues Is there a simple way to determine the timezone offset for my present location. For example, during standard time in the US, the offset from GMT is 8 hours in California. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com <http://www.plessthan.com/> [[alternative HTML version deleted]]
Hi Dennis, I believe that it may be as simple as:> format(Sys.time(), "%z")[1] "-0400" Where "%z" returns the offset from UTC as a character vector, and where I am in:> Sys.timezone()[1] "America/New_York" There may be some subtleties, and I would suggest reading the relevant help files for ?strptime and the above two functions. Regards, Marc Schwartz ?-----Original Message----- From: R-help <r-help-bounces at r-project.org <mailto:r-help-bounces at r-project.org>> on behalf of Dennis Fisher <fisher at plessthan.com <mailto:fisher at plessthan.com>> Date: Thursday, August 17, 2023 at 4:31 PM To: <r-help at r-project.org <mailto:r-help at r-project.org>> Subject: [R] Timezone question R 4.3.1 OS X Colleagues Is there a simple way to determine the timezone offset for my present location. For example, during standard time in the US, the offset from GMT is 8 hours in California. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com <http://www.plessthan.com/> <http://www.plessthan.com/>>
You may also find the package "lutz" to be of interest, although that may be overkill for your needs. (found by an internet search). Cheers, Bert On Thu, Aug 17, 2023 at 1:31?PM Dennis Fisher <fisher at plessthan.com> wrote:> R 4.3.1 > OS X > > Colleagues > > Is there a simple way to determine the timezone offset for my present > location. For example, during standard time in the US, the offset from GMT > is 8 hours in California. > > Dennis > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone / Fax: 1-866-PLessThan (1-866-753-7784) > www.PLessThan.com <http://www.plessthan.com/> > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]