[R] POSIX, time zone and Windows

From: Patrick Giraudoux <patrick.giraudoux_at_univ-fcomte.fr>
Date: Mon 22 May 2006 - 01:05:59 EST


Dear Listers,

Apologize to pile up on the 'tz' issue in POSIX objects. I have a 'simple' thing on which I must make up my mind but cannot do it from the existing R-help threads. I am currently working on dog telemetry in China, and download time information from GPS collars. I would like to set up the corresponding POSIXxx variables in R to a given time zone. Eg Pekin GMT+8:00.

I cannot find out how to do it properly. For instance:

mydate<-""06/05/16/11:30:00""
mydate<-strptime(mydate, "%y/%m/%d/%H:%M:%S")

mydate
[1] "2006-05-16 11:30:00"

as.POSIXct(mydate)
[1] "2006-05-16 11:30:00 Paris, Madrid"

Which is obviously not what I wish regarding the specification Paris, Madrid...

I have tried to pass something to the argument tz

mydate2<-strptime(mydate, "%y/%m/%d/%H:%M:%S",tz="GMT") or mydate2<-strptime(mydate, "%y/%m/%d/%H:%M:%S",tz="GMT+08")

I get this:

mydate2
[1] NA

Is there a way to specify the time zone on which I was working (actually GTM + 8:00)? I have read in R-help that this is system dependent, but the how to do it still escape. Working with Windows, I have checked the following address given by Gabor Grothendieck in R-help, http://msdn2.microsoft.com/en-us/library/90s5c885.aspx, but I cannot manage with the syntax: *TZ*=tzn[+ | ]hh[*:*mm[*:*ss] ][dzn]. They mention a three lettre time zone (where can the corresponding codes be found?) to which to add a difference in hours between UTC and the local time... but any trial I did specifying tz="UTM+08" or other combination leads nowhere...

Thanks for any hint...

Patrick



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 Received on Mon May 22 01:23:15 2006

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 Mon 22 May 2006 - 02:10:15 EST.

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