[Rd] Revisit c.POSIXlt , [<-.POSIXlt , [[<-.POSIXlt ?

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Tue Jun 16 01:25:39 CEST 2026


>>>>> Martin Maechler 
>>>>>     on Mon, 15 Jun 2026 18:08:43 +0200 writes:

>>>>> Suharto Anggono Suharto Anggono 
>>>>>     on Sun, 14 Jun 2026 13:37:13 +0000 (UTC) writes:

    >> Could at least a minimalistic fix be put for the upcoming R 4.6.1? For example:
    >> ln '[<-.POSIXlt' and '[[<-.POSIXlt', change
    >>     else as.POSIXlt(as.POSIXct(value), tz = tz[1L]))
    >> to
    >>     else as.POSIXlt(as.POSIXct(value), tz = if(is.null(tz)) "" else tz[1L]))

    >> In 'c.POSIXlt', apply 'floor' to the 'sec' component before converting to POSIXct like in Bug 18989 Comment 9 (https://bugs.r-project.org/show_bug.cgi?id=18989#c9).


    > Yes, this *could* be done, last minute, i.e., fixing some bugs
    > in POSIXlt <--> POSIXct  handling.

    > I've tried in my local copy of  "R 4.6.1 beta".

    > and indeed, these minimal patches already fix the two problems
    > you mention below (and I've marked with  '1.'  and '2.' ).

    > *However* your wish is rather late (we have code freeze in 1.5 days and
    > should only fix somewhat urgent problems with small fixes), 
    > *and* the two problematic examples below are not new bugs, they
    > do "not work" already in 4.4.x (I tried one) and 4.5.0, .. 4.5.3, etc

    > Whereas your proposed changes *are* nicely small and look
    > sensible, the bugs (below) have been in R for a while now *and*
    > are fixed in R-devel (already with svn r89926 I think).

    > So I don't know if there is anybody (but you ;-) who'd be very
    > happy for such a late bug fix.

    > Other opinions -- notably R core / Release Manager ?

    > Thank you in any case, for the suggestion, and the effort to
    > find such a minimal (informal) patch.

    > Best regards,
    > Martin


I've decided to commit these -- together with the
as.matrix(<POSIXlt>)  bug fix, ported from R-devel.

So these should make into R 4.6.1  next week.

Best regards,
Martin



More information about the R-devel mailing list