[Rd] ISOdate and strptime results are not interoperable (PR#14076)

mariotomo at gmail.com mariotomo at gmail.com
Fri Nov 20 09:35:11 CET 2009


Full_Name: Mario Frasca
Version: 2.9.2, 2.10.0, 2.8.1
OS: ubuntu 9.10, Debian sid, MacOSX 10.4
Submission from: (NULL) (194.151.158.193)


The objects being returned by the functions strptime and ISOdate look the same
(to me) but behave differently.  The difference is influenced by the current
timezone of the system.  

> epoch_strptime <- strptime("1970-01-01 00:00:00", "%Y-%m-%d %H:%M:%S",
tz="UTC")
> epoch_isodate <- ISOdate(1970,1,1,0,0,0, tz="UTC")
> epoch_strptime
[1] "1970-01-01 UTC"
> epoch_isodate
[1] "1970-01-01 UTC"
> mode(epoch_strptime)
[1] "list"
> mode(epoch_isodate)
[1] "numeric"
> # the system is currently in timezone CET (Europe/Rome)
> epoch_isodate - epoch_strptime
Time difference of 1 hours
> # using time-admin to move to timezone COT (America/Bogota)
> epoch_isodate - epoch_strptime
Time difference of -5 hours



More information about the R-devel mailing list