[R] Does strptime(...,tz="GMT") do anything?

From: David Forrest <drf5n_at_maplepark.com>
Date: Mon 08 Jan 2007 - 22:48:32 GMT


Hi All

In trying to correlate some tide gauge data I need to deal with varying timezones. From the documentation on strptime, it seemed that the tz variable might have some effect on the conversion, but I'm not seeing an effect.

> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="PST")+0
[1] "2006-12-01 01:02:00 EST"
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="")+0
[1] "2006-12-01 01:02:00 EST"
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="GMT")+0
[1] "2006-12-01 01:02:00 EST"
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="UTC")+0
[1] "2006-12-01 01:02:00 EST"
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="EST")+0
[1] "2006-12-01 01:02:00 EST" What is the recommended way of handling this? Computing and adding offsets manually?

> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="UTC")+3600*3
[1] "2006-12-01 04:02:00 EST" Or am I doing something wrong with the strptime(..., tz="EST") function?

Thanks for your time,
Dave

-- 
  Dr. David Forrest
  drf@vims.edu                                    (804)684-7900w
  drf5n@maplepark.com                             (804)642-0662h
                                    http://maplepark.com/~drf5n/

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Tue Jan 09 10:24:20 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 09 Jan 2007 - 06:30:29 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.