@@ -1597,18 +1597,31 @@ tools::assertWarning(verbose=TRUE,
15971597# # format.POSIXlt() of Jan.1 if 1941 or '42 is involved:
15981598tJan1 <- function (n1 , n2 )
15991599 strptime(paste0(n1 : n2 ," /01/01" ), " %Y/%m/%d" , tz = " CET" )
1600- wDSTJan1 <- function (n1 , n2 )
1601- which(" CEST" == sub(" .* " , ' ' , format(tJan1(n1 ,n2 ), usetz = TRUE )))
1602- (w8 <- wDSTJan1(1801 , 2300 ))
1603- (w9 <- wDSTJan1(1901 , 2300 ))
1604- stopifnot(identical(w8 , 141 : 142 ),# exactly 1941:1942 had CEST on Jan.1
1605- identical(w9 , 41 : 42 ))
1600+ f8 <- format(tJan1(1801 , 2300 ), usetz = TRUE )
1601+ f9 <- format(tJan1(1901 , 2300 ), usetz = TRUE )
1602+ rle8 <- rle(s8 <- sub(" .* " ,' ' , f8 ))
1603+ rle9 <- rle(s9 <- sub(" .* " ,' ' , f9 ))
1604+ w8 <- which(s8 == " CEST" )
1605+ w9 <- which(s9 == " CEST" )
1606+ # # IGNORE_RDIFF_BEGIN
1607+ rle8
1608+ # # very platform dependently; originally got
1609+ # # lengths: int [1:3] 140 2 358
1610+ # # values : chr [1:3] "CET" "CEST" "CET"
1611+ w8 # 141 142
1612+ w9 # 41 42
1613+ # # IGNORE_RDIFF_END
1614+ # # Debian's tzdata 2024b no longer contains "legacy" (but tzdata-legacy does)
1615+ # # --> everything "CET" [ <==> !length(w..) ]
1616+ stopifnot(! length(w8 ) || identical(w8 , 141 : 142 ),# exactly 1941:1942 had CEST on Jan.1
1617+ ! length(w9 ) || identical(w9 , 41 : 42 ))
16061618# # for R-devel Jan.2016 to Mar.14 -- *AND* for R 3.2.4 -- the above gave
16071619# # integer(0) and c(41:42, 99:100, ..., 389:390) respectively
1608-
1620+ # #
16091621# # the above gives 1:142 and 1:42 respectively on Solaris 10 when not using
16101622# # --with-internal-tzcode; R-Admin recommends --with-internal-tzcode.
16111623
1624+
16121625# # tsp<- did not remove mts class
16131626z <- ts(cbind(1 : 5 ,1 : 5 ))
16141627tsp(z ) <- NULL
0 commit comments