Class TimeCategory

java.lang.Object
org.apache.groovy.dateutil.TimeCategory

public class TimeCategory extends Object
A dequirked, java.util.Date-flavored parallel to the legacy groovy.time.TimeCategory. Use as:
 use (org.apache.groovy.dateutil.TimeCategory) {
     println 1.minute.from.now
     println 10.hours.ago
     def someDate = new Date()
     println someDate - 3.months
 }
 
Differences from the legacy class: the deprecated getTimeZone and the getDaylightSavingsOffset helpers are dropped, and .ago/.from.now preserve the time-of-day (see BaseDuration).
See Also: