groovy.time
Class Duration
- author:
- John Wilson tug@wilson.co.uk
Duration represents time periods which have values independant of the context.
So, whilst we can't say how long a month is without knowing the year and the name of the month,
we know how long a day is independant of the date.
This is not 100% true for days.
Days can actually be 23, 24 or 25 hours long (due to daylight saving adjustments)
If you ask Duration to convert itself to milliseconds then it will work on the basis of 24 hours
in a day. If you add or subtract it from a date it will take daylight saving into account.
|
Constructor Summary |
Duration(int days, int hours, int minutes, int seconds, int millis)
|
Duration
public Duration(int days, int hours, int minutes, int seconds, int millis)
-
getAgo
public Date getAgo()
-
getFrom
public From getFrom()
-
minus
public Duration minus(Duration rhs)
-
minus
public TimeDuration minus(TimeDuration rhs)
-
minus
public DatumDependentDuration minus(DatumDependentDuration rhs)
-
minus
public TimeDatumDependentDuration minus(TimeDatumDependentDuration rhs)
-
plus
public Duration plus(Duration rhs)
-
plus
public Duration plus(TimeDuration rhs)
-
plus
public DatumDependentDuration plus(DatumDependentDuration rhs)
-
toMilliseconds
public long toMilliseconds()
-