public class TimeDuration
extends Duration
| Constructor and description |
|---|
TimeDuration(int hours, int minutes, int seconds, int millis)Creates a time duration without a day component. |
TimeDuration(int days, int hours, int minutes, int seconds, int millis)Creates a time duration with an optional day component. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Date |
getAgo()Returns the date represented by this duration ago. |
|
public From |
getFrom()Returns a helper for computing dates relative to now. |
|
public Duration |
minus(Duration rhs)Subtracts a fixed duration. |
|
public DatumDependentDuration |
minus(DatumDependentDuration rhs)Subtracts a datum-dependent duration. |
|
public Duration |
plus(Duration rhs)Adds a fixed duration. |
|
public DatumDependentDuration |
plus(DatumDependentDuration rhs)Adds a datum-dependent duration. |
| Methods inherited from class | Name |
|---|---|
class Duration |
getAgo, getFrom, minus, minus, minus, minus, plus, plus, plus, toMilliseconds |
class BaseDuration |
compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString |
Creates a time duration without a day component.
hours - the hour componentminutes - the minute componentseconds - the second componentmillis - the millisecond componentCreates a time duration with an optional day component.
days - the day componenthours - the hour componentminutes - the minute componentseconds - the second componentmillis - the millisecond componentReturns the date represented by this duration ago.
Returns a helper for computing dates relative to now.
Subtracts a fixed duration.
rhs - the duration to subtractSubtracts a datum-dependent duration.
rhs - the duration to subtractAdds a fixed duration.
rhs - the duration to addAdds a datum-dependent duration.
rhs - the duration to addCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.