library(lubridate) dates <- c("2011-01-17", "2009-11-21") p <- as.period( interval( ymd(dates), Sys.Date() ) ) year(p)*12 + month(p) interval(dates, today()) %/% months(1)