[R] Extent of time zone vulerability for POSIX date and time classes

From: Tim Bergsma <timb_at_metrumrg.com>
Date: Thu 05 Apr 2007 - 13:46:38 GMT


Hi.

I frequently convert date and time data to and from character representations. I'm frustrated with chron, because 'seconds' are required to create a time object (my input data never has seconds). More importantly, I cannot make chron print the format 12/30/2006 (which my output data requires).

I really like the format flexibility of strftime() and strptime(), but of course am paranoid about timezone issues. After reading the standard reference several times
(
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf), I am tempted to conclude that if I never specify timezones, and never use Sys.time(), the vulnerabilities do not pertain.

To the point: if I'm merely converting to and from character data that does not represent time zones, is there still a time zone vulnerability with strftime() and strptime()?

Thanks in advance,

Tim Bergsma, PhD
Metrum Research Group, LLC

#example
strftime(

   strptime(

     "30-Dec-06 23:30",
     format="%d-%b-%y %H:%M"

   ),
   format="%m/%d/%Y %H:%M"
)
[1] "12/30/2006 23:30"


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 Fri Apr 06 00:06:21 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 Thu 05 Apr 2007 - 15:30:47 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.