4 ms·
Does lubridate solve the unintended timezone conversions of POSIXct classes?
by mapcar 12y ago
Does lubridate solve the unintended timezone conversions of POSIXct classes?
- hadley 12y agoCan you provide a bit more detail?
- mapcar 12y agoIn the R Help Desk 2004 (http://www.r-project.org/doc/Rnews/Rnews_2004-1.pdf http://www.r-project.org/doc/Rnews/Rnews_2004-1.pdf), Gabor Grothendieck recommends chron over POSIXct classes on account of the time zone conversions which occur when the tz attribute of the latter object is not "GMT". Will this not be a problem with lubridate? Thanks in advance.
- hadley 12y agoI've never found that to be a problem in practice. Do you have an example where it's bitten you in practice? (Also you should use UTC and not GMT)
- mapcar 12y agoHi Hadley, yes for instance > as.chron("1970-01-01")+unclass(as.chron("2001-04-01")) [1] 04/01/01 > as.POSIXct("1970-01-01","EST")+unclass(as.POSIXct("2014-06-01","EST")) [1] "2014-06-01 05:00:00 EST" If there is any conversion necessary it is difficult to get back the original intended time.