Month(as.ym(202408))
Year(as.ym(202408))
Year(as.Date("2024-12-05"))
Year(as.ym(202412))
Month(as.Date("2024-12-05"), fmt = "mm")
Month(as.ym(202412), fmt="mm")
AddMonths(201511, 5)
AddMonths(c(201511, 201302), c(5, 15))
AddMonths(c(201511, 201302), c(5, -4))
Run the code above in your browser using DataLab