[R] ISO 8601 Weeks/Years on Windows with strptime

Michael Höhle Michael.Hoehle at stat.uni-muenchen.de
Thu Jun 3 10:57:12 CEST 2010

Dear R-help,

I am working on a R package for public health surveillance where the ISO
8601 representation of dates is of importance. Especially, the ISO Week
and ISO Year of a date needs to be extracted. I was quite happy to find
all of this implemented in the "Date" class with appropriate calls to
strptime/format (using e.g. %G and %V).

However, only later I realized that this functionality is currently not
implemented on Windows (I'm a happy Mac/Linux user). As this seriously
limits the applicability, I would like to enquire, if there are any plans
to make this functionality available in Windows as well? Or are there any
good workarounds to make

> format.Date("2001-12-31", "%G")

give "2002" instead of "" on Windows?

Best regards,

Michael Höhle


> sessionInfo()
R version 2.10.0 (2009-10-26)

[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
 [1] surveillance_1.1-6 Matrix_0.999375-31 msm_0.9.7          vcd_1.2-8
 [5] colorspace_1.0-1   MASS_7.3-3         maptools_0.7-34    lattice_0.17-26
 [9] foreign_0.8-40     sp_0.9-62          spc_0.3            xtable_1.5-6

loaded via a namespace (and not attached):
[1] mvtnorm_0.9-9   splines_2.10.0  survival_2.35-7 tools_2.10.0

More information about the R-help mailing list