R/date.R
year.Rd
Extract Year/Month/Day from date string
year(x) month(x) day(x)
Character or Date vector.
Numeric vector
D = c("2021-1-1", "2015/9/25") year(D) #> [1] 2021 2015 month(D) #> [1] 1 9 day(D) #> [1] 1 25