Skip to contents

Converts a date to an ISO-week-based quarter (1 to 4), returned as a character string.

Usage

date_to_isoquarter_c(x = lubridate::today())

# Default S3 method
date_to_isoquarter_c(x)

# S3 method for class 'character'
date_to_isoquarter_c(x = lubridate::today())

# S3 method for class 'Date'
date_to_isoquarter_c(x = lubridate::today())

Arguments

x

A Date object, or a character string in the format 'yyyy-mm-dd'.

Value

ISO quarter as a character vector (e.g. "3").

Details

The quarter is derived from the ISO week. See date_to_isoquarter_n() for the week-to-quarter boundaries.

See also

vignette("date_conversion", package = "cstime") for worked date, ISO year and ISO week conversions. No vignette runs this function.

Other date-to-character converters: date_to_calmonth_c(), date_to_calyear_c(), date_to_calyearmonth_c(), date_to_isoweek_c(), date_to_isoyear_c(), date_to_isoyearquarter_c(), date_to_isoyearweek_c()

Examples

date_to_isoquarter_c(as.Date("2021-08-11"))
#> [1] "3"
date_to_isoquarter_c("2021-01-01")
#> [1] "4"