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

From: <mariotomo_at_gmail.com>
Date: Fri, 20 Nov 2009 09:35:11 +0100 (CET)


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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 20 Nov 2009 - 12:33:58 GMT

This archive was generated by hypermail 2.2.0 : Fri 20 Nov 2009 - 14:30:35 GMT