New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
devel
but looking atas.ITime.POSIXct
, it's identical to the one I've on my system.This is incorrect because
tz
is assumed to beUTC
ifattr(x, 'tzone')
returnsNULL
which is the case forSys.time()
.Why we need
tz
info to extract HH:MM:SS from a timestamp if I already provide aPOSIXct
object?I upgraded from
1.10.4-3
which seems to not have thisPOSIXct
method and delegates to.default
, which handles it withas.ITime(as.POSIXlt(x, ...))
. Looking at thePOSIXct
method, it seems similar to olddefault
but with a special case forGMT
/UTC
. Why so?The text was updated successfully, but these errors were encountered: