[R] time zone conversion

From: simon <sentientc_at_gmail.com>
Date: Tue 06 Dec 2005 - 03:57:35 EST

Dear R-help,

I was trying to convert a date and time record extracted from a fortran subroutine I worte and I encounter some problem. The data read in time and date in a format like "2000-05-11_01:00:00.0000" in fortran output. It is in GMT. I need to convert it to CST (GMT+8). I did the following steps.
> cdate

[1] "2000-05-11_01:00:00.0000\005\003"
# I am not sure why the extra characters at the end but it doesn't affect the strptime function so I just ingored it.
> strptime(cdate,format="%Y-%m-%d_%H:%M:%S")
[1] "2000-05-11 01:00:00"
# In order to incoporate GMT into the record, I use paste function to stick it in.

[1] "2000-05-11 01:00:00 GMT"
#It is easier to just do a arthmatic to convert the timezone and ingore this attribute like


[1] "2000-05-11 09:00:00 CST"
I was wondering if there is a simpler method to do this.

Thanks in advance,


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 Tue Dec 06 04:07:39 2005

This archive was generated by hypermail 2.1.8 : Tue 06 Dec 2005 - 09:26:19 EST