Groovy: Get duration in years
问题 On running the following code in groovy - import groovy.time.* import org.codehaus.groovy.runtime.TimeCategory def today = new Date() use(TimeCategory) { def modifiedToday = today.plus(10.minutes) modifiedToday = modifiedToday.plus(10.months) modifiedToday = modifiedToday.plus(10.years) def duration = modifiedToday - today println duration.years println duration.months println duration.days println duration.minutes } I am getting the following output - 0 0 3956 10 Please suggest, why am I