[R] how to calculate time offset between timezones?

From: dankelley <Dan.Kelley_at_dal.ca>
Date: Thu, 10 Jan 2008 07:21:15 -0800 (PST)

#QUESTION# Is there a way to calculate the offset between timezones, e.g. from "AST" to "GMT"? #DETAILS# I am working with data files that use local time, and that indicate the timezone by e.g. "AST" (Atlantic Standard Time, my local time) in a header. I was guessing that

> ISOdatetime(2008,1,1,1,0,0,tz="GMT") -
> ISOdatetime(2008,1,1,1,0,0,tz="AST")

would work, but it gives a difference of 0. However, when I do

> ISOdatetime(2008,1,1,1,0,0,tz="GMT") - ISOdatetime(2008,1,1,1,0,0)

I get a -4h offset, which is correct. The odd thing is, I am in AST time, as shown by the following.

> ISOdatetime(2008,1,1,1,0,0)

[1] "2008-01-01 01:00:00 AST" #SYSTEM# Mac OS X system, with R 2.6.1


I am aware that this sort of thing is system dependent, and so there may not be a general solution. But even if I can only get it working on my own particular system, I'd be happy!

View this message in context: http://www.nabble.com/how-to-calculate-time-offset-between-timezones--tp14736453p14736453.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 10 Jan 2008 - 15:24:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Jan 2008 - 16:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive