[R] POSIX, time zone and Windows
Patrick Giraudoux
patrick.giraudoux at univ-fcomte.fr
Sun May 21 17:05:59 CEST 2006
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
More information about the R-help
mailing list