Find calendar date for a weekday in a given month. For example, you might want to know the date for the second Wednesday of December in the current year. This is the typical date for the meeting of the Joint Technical Committee for the Pacific Hake stock assessment.

calc_calendar_date(
  number = 2,
  month = 12,
  year = as.numeric(format(Sys.time(), "%Y")),
  weekday = "Wednesday"
)

Arguments

number

The iteration you want, e.g., 2 for second.

month

An integer for the desired month. Options include values in 1:12.

year

The year of interest as a four-digit integer.

weekday

The day of the week that you are interested in. For example, "Wednesday" is the default.

Author

Kelli F. Johnson

Examples

# Find second Wednesday in December of current year
calc_calendar_date()
#> [1] "2024-12-11"
# Find third Wednesday in December of current year
calc_calendar_date(3)
#> [1] "2024-12-18"