Package groovy.time
Class TimeCategory
- java.lang.Object
- 
- groovy.time.TimeCategory
 
- 
 public class TimeCategory extends Object Apply a number of methods to allow convenient Date/Time manipulation,such as:use (groovy.time.TimeCategory) { // application on numbers: println 1.minute.from.now println 10.hours.ago // application on dates def someDate = new Date() println someDate - 3.months }- See Also:
- BaseDuration
 
- 
- 
Constructor SummaryConstructors Constructor Description TimeCategory()
 - 
Method Summary
 
- 
- 
- 
Method Detail- 
pluspublic static Date plus(Date date, BaseDuration duration) 
 - 
minuspublic static Date minus(Date date, BaseDuration duration) 
 - 
getTimeZone@Deprecated public static TimeZone getTimeZone(Date self) Deprecated.Retrieves the default TimeZone for a date by using the default Locale settings. Recommended that you useTimeZone.getDefault()instead.- Parameters:
- self- a Date
- Returns:
- the TimeZone
 
 - 
getDaylightSavingsOffsetpublic static Duration getDaylightSavingsOffset(Date self) Get the DST offset (if any) for the default locale and the given date.- Parameters:
- self- a Date
- Returns:
- the DST offset as a Duration.
 
 - 
getDaylightSavingsOffsetpublic static Duration getDaylightSavingsOffset(BaseDuration self) 
 - 
getRelativeDaylightSavingsOffsetpublic static Duration getRelativeDaylightSavingsOffset(Date self, Date other) Return a Duration representing the DST difference (if any) between two dates. i.e. if one date is before the DST changeover, and the other date is after, the resulting duration will represent the DST offset.- Parameters:
- self- a Date
- other- another Date
- Returns:
- a Duration
 
 - 
minuspublic static TimeDuration minus(Date lhs, Date rhs) Subtract one date from the other.- Parameters:
- lhs- a Date
- rhs- another Date
- Returns:
- a Duration
 
 - 
getMonthspublic static DatumDependentDuration getMonths(Integer self) 
 - 
getMonthpublic static DatumDependentDuration getMonth(Integer self) 
 - 
getYearspublic static DatumDependentDuration getYears(Integer self) 
 - 
getYearpublic static DatumDependentDuration getYear(Integer self) 
 - 
getHourspublic static TimeDuration getHours(Integer self) 
 - 
getHourpublic static TimeDuration getHour(Integer self) 
 - 
getMinutespublic static TimeDuration getMinutes(Integer self) 
 - 
getMinutepublic static TimeDuration getMinute(Integer self) 
 - 
getSecondspublic static TimeDuration getSeconds(Integer self) 
 - 
getSecondpublic static TimeDuration getSecond(Integer self) 
 - 
getMillisecondspublic static TimeDuration getMilliseconds(Integer self) 
 - 
getMillisecondpublic static TimeDuration getMillisecond(Integer self) 
 
- 
 
-