Skip to contents

Computes the water year that a date falls in, where the water year runs from Oct 1 - Sept 30.

Usage

getWaterYear(date)

Arguments

date

A date-time object

Value

The water year of date as an integer number

Examples

my_date <- as.Date("2022-02-01")
getWaterYear(my_date)  # 2022
#> [1] 2022
another_date <- as.Date("2022-10-01") # 2023