# input vector is of class Date
times <- seq(from = Sys.Date(), to = Sys.Date() + 500, by = 20)
season(times)
# input vector is numeric (the day of the year)
n <- as.numeric(format(times, "%j"))
season(n)
identical(season(times), season(n))
Run the code above in your browser using DataLab