Construct a time duration of 0 milliseconds
nothing
Construct a time duration from a string in one of two formats:
timezonecomplete.Argument.S for invalid string
Construct a duration from an amount and a time unit.
Number of units
Optional
unit: TimeUnitA time unit i.e. TimeUnit.Second, TimeUnit.Hour etc. Default Millisecond.
timezonecomplete.Argument.Amount if amount
is not a finite number
timezonecomplete.Argument.Unit for invalid unit
Allow not using instanceof
Returns this duration expressed in different unit (positive or negative, fractional). This is precise for Year <-> Month and for time-to-time conversion (i.e. Hour-or-less to Hour-or-less). It is approximate for any other conversion
nothing
Convert this duration to a Duration in another unit. You always get a clone even if you specify the same unit. This is precise for Year <-> Month and for time-to-time conversion (i.e. Hour-or-less to Hour-or-less). It is approximate for any other conversion
nothing
Divide by a unitless number. The result is a Duration, e.g. 1 year / 2 = 0.5 year The result is approximate if this duration as a unit that cannot be converted to a number (e.g. 1 month has variable length)
a new Duration of (this / value)
timezonecomplete.Argument.Value if value is 0 or non-finite
Divide this Duration by a Duration. The result is a unitless number e.g. 1 year / 1 month = 12 The result is approximate if this duration as a unit that cannot be converted to a number (e.g. 1 month has variable length)
a new Duration of (this / value)
timezonecomplete.Argument.Value if the duration is 0
Similar but not identical Approximate if the durations have units that cannot be converted
True iff this and other represent the same time duration
nothing
Similar but not identical Returns false if we cannot determine whether they are equal in all time zones so e.g. 60 minutes equals 1 hour, but 24 hours do NOT equal 1 day
True iff this and other represent the same time duration
nothing
Approximate if the durations have units that cannot be converted
True iff this >= other
nothing
Approximate if the durations have units that cannot be converted
True iff this > other
nothing
Same unit and same amount
nothing
Approximate if the durations have units that cannot be converted
True iff (this <= other)
nothing
Approximate if the durations have units that cannot be converted
True iff (this < other)
nothing
Static
daysStatic
hoursStatic
millisecondsStatic
minutesStatic
monthsStatic
secondsStatic
years
Time duration which is represented as an amount and a unit e.g. '1 Month' or '166 Seconds'. The unit is preserved through calculations.
It has two sets of getter functions: