Derive water year value for a date

water_year(date, start_month = 10, start_hour = 9, tz = "UTC")

Arguments

date

the (vector of) dates for which the water year will be calculated

start_month

the month in which the water year starts, default is October

start_hour

the time of the day in which the water year starts, default is 9

tz

time zone for the record, defaults to "UTC"

Value

The water year value

Examples

if (FALSE) { # \dontrun{
water_year(c(as.POSIXct("1958-10-01 09:00:00", tz = "UTC"),
             as.POSIXct("2021-10-01 12:00:00", tz = "UTC"),
             as.POSIXct("1918-10-01 08:55:00", tz = "UTC")))

water_year(c(as.Date("2021-01-01"),as.Date("2021-11-01"),
as.Date("2019-02-01"),as.Date("1965-09-30")))
} # }