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.
BaseDuration.From
Constructor and Description |
---|
Duration(int days,
int hours,
int minutes,
int seconds,
int millis) |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getAgo() |
BaseDuration.From |
getFrom() |
DatumDependentDuration |
minus(DatumDependentDuration rhs) |
Duration |
minus(Duration rhs) |
TimeDatumDependentDuration |
minus(TimeDatumDependentDuration rhs) |
TimeDuration |
minus(TimeDuration rhs) |
DatumDependentDuration |
plus(DatumDependentDuration rhs) |
Duration |
plus(Duration rhs) |
Duration |
plus(TimeDuration rhs) |
long |
toMilliseconds() |
compareTo, getDays, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toString
public Duration(int days, int hours, int minutes, int seconds, int millis)
public Duration plus(TimeDuration rhs)
public DatumDependentDuration plus(DatumDependentDuration rhs)
public TimeDuration minus(TimeDuration rhs)
public DatumDependentDuration minus(DatumDependentDuration rhs)
public TimeDatumDependentDuration minus(TimeDatumDependentDuration rhs)
public long toMilliseconds()
toMilliseconds
in class BaseDuration
public java.util.Date getAgo()
getAgo
in class BaseDuration
public BaseDuration.From getFrom()
getFrom
in class BaseDuration