Package org.apache.groovy.dateutil
Class TimeCategory
java.lang.Object
org.apache.groovy.dateutil.TimeCategory
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Durationstatic Durationstatic TimeDurationstatic TimeDurationstatic TimeDurationgetMillisecond(Integer self) static TimeDurationgetMilliseconds(Integer self) static TimeDurationstatic TimeDurationgetMinutes(Integer self) static DatumDependentDurationstatic DatumDependentDurationstatic TimeDurationstatic TimeDurationgetSeconds(Integer self) static Durationstatic Durationstatic DatumDependentDurationstatic DatumDependentDurationstatic TimeDurationstatic Dateminus(Date date, BaseDuration duration) static Dateplus(Date date, BaseDuration duration)
-
Constructor Details
-
TimeCategory
public TimeCategory()
-
-
Method Details
-
plus
-
minus
-
minus
-
getMonths
-
getMonth
-
getYears
-
getYear
-
getWeeks
-
getWeek
-
getDays
-
getDay
-
getHours
-
getHour
-
getMinutes
-
getMinute
-
getSeconds
-
getSecond
-
getMilliseconds
-
getMillisecond
-