[Rd] Regression in strptime

peter dalgaard pdalgd at gmail.com
Sat Mar 12 09:33:28 CET 2016

> On 12 Mar 2016, at 00:05 , Mick Jordan <mick.jordan at oracle.com> wrote:
> This is definitely obscure but we had a unit test that called .Internal(strptime, "1942/01/01", %Y/%m/%d") with timezone (TZ) set to CET.

Umm, that doesn't even parse. And fixing the typo, it doesn't run:

> .Internal(strptime, "1942/01/01", %Y/%m/%d")
Error: unexpected SPECIAL in ".Internal(strptime, "1942/01/01", %Y/%"
> .Internal(strptime, "1942/01/01", "%Y/%m/%d")
Error in .Internal(strptime, "1942/01/01", "%Y/%m/%d") : 
  3 arguments passed to '.Internal' which requires 1

> In R-3.1.3 that returned "1942-01-01 CEST" which, paradoxically, is correct as they evidently did strange things in Germany during the war period. Java also returns the same. However, R-3.2.4 returns "1942-01-01 CET".

Did you mean:

pd$ r-release-branch/BUILD-dist/bin/R

R version 3.2.4 Patched (2016-03-10 r70319) -- "Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0/x86_64 (64-bit)
> strptime("1942/01/01", "%Y/%m/%d", tz="CET")
[1] "1942-01-01 CEST"

But then as you see, it does have DST on New Years Day.

All in all, there is something you are not telling us.

Notice that all DST information is OS dependent as it depends on which version of the "Olson database" is installed.

> Mick Jordan
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com

More information about the R-devel mailing list