Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBug in as.ITime.POSIXct #4085
Bug in as.ITime.POSIXct #4085
Comments
|
the numeric method (hence unclass), which assumes UTC time, is much more efficient than POSIXlt conversion the is.null branch does look error prone because of the default tz issue |
|
@jangorecki added that here: was there a reason for defaulting NULL tz to UTC? |
|
@MichaelChirico |
|
I don't follow well because I'm on mobile but yes I think the POSIXlt route is appropriate for NULL tz. unless we have a reason to keep it I would just delete the is.null branch and all should be fine |
|
Yes, check for |
|
Ah okay, thank you. Seems like an oversight.. I think |
|
Hmm, strangely
|
|
That's a good point. Perhaps that's the reason... Hm, now I'm not so sure. |
|
I see this in r-devel from @joshuaulrich: https://stat.ethz.ch/pipermail/r-devel/2013-March/066221.html
Seems nothing changed since then however... The more I look at it the more I think we should break from base R behavior which feels wrong |
|
Also apparently no response here to Josh https://stat.ethz.ch/pipermail/r-devel/2018-October/077005.html
|
|
Kurt Hornik responded privately to my question about my |
I haven't tested on
develbut looking atas.ITime.POSIXct, it's identical to the one I've on my system.This is incorrect because
tzis assumed to beUTCifattr(x, 'tzone')returnsNULLwhich is the case forSys.time().Why we need
tzinfo to extract HH:MM:SS from a timestamp if I already provide aPOSIXctobject?I upgraded from
1.10.4-3which seems to not have thisPOSIXctmethod and delegates to.default, which handles it withas.ITime(as.POSIXlt(x, ...)). Looking at thePOSIXctmethod, it seems similar to olddefaultbut with a special case forGMT/UTC. Why so?