Converts a date to its ISO 8601 week number, returned as a zero-padded character string.
Details
ISO weeks run Monday to Sunday and are numbered 01 to 52 or 53. Week 01 is the week containing the first Thursday of the ISO year. The week is returned as two digits, e.g. "01" or "53".
See also
vignette("date_conversion", package = "cstime"), which runs this
function.
Other date-to-character converters:
date_to_calmonth_c(),
date_to_calyear_c(),
date_to_calyearmonth_c(),
date_to_isoquarter_c(),
date_to_isoyear_c(),
date_to_isoyearquarter_c(),
date_to_isoyearweek_c()
Examples
date_to_isoweek_c(as.Date("2021-08-11"))
#> [1] "32"
date_to_isoweek_c("2021-01-01")
#> [1] "53"
