|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.time.BaseDuration groovy.time.Duration
public class Duration extends BaseDuration
Duration represents time periods which have values independent 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 independent 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.
Field Summary |
---|
Fields inherited from class BaseDuration | |
---|---|
days, hours, millis, minutes, months, seconds, years |
Constructor Summary | |
Duration(int days, int hours, int minutes, int seconds, int millis)
|
Method Summary | |
---|---|
java.util.Date
|
getAgo()
|
From
|
getFrom()
|
Duration
|
minus(Duration rhs)
|
TimeDuration
|
minus(TimeDuration rhs)
|
DatumDependentDuration
|
minus(DatumDependentDuration rhs)
|
TimeDatumDependentDuration
|
minus(TimeDatumDependentDuration rhs)
|
Duration
|
plus(Duration rhs)
|
Duration
|
plus(TimeDuration rhs)
|
DatumDependentDuration
|
plus(DatumDependentDuration rhs)
|
long
|
toMilliseconds()
|
Methods inherited from class BaseDuration | |
---|---|
compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public Duration(int days, int hours, int minutes, int seconds, int millis)
Method Detail |
---|
public java.util.Date getAgo()
public From getFrom()
public Duration minus(Duration rhs)
public TimeDuration minus(TimeDuration rhs)
public DatumDependentDuration minus(DatumDependentDuration rhs)
public TimeDatumDependentDuration minus(TimeDatumDependentDuration rhs)
public Duration plus(Duration rhs)
public Duration plus(TimeDuration rhs)
public DatumDependentDuration plus(DatumDependentDuration rhs)
public long toMilliseconds()
Groovy Documentation