Package: groovy.time

## [Java] Class TimeDuration

- groovy.time.TimeDuration

-     public class TimeDuration
      extends Duration

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class BaseDuration` | `days, hours, millis, minutes, months, seconds, years`

  - ### Constructor Summary

    Constructors
    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.

  - ### Methods Summary

    Methods
    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.

  - ### Inherited Methods Summary

    Inherited Methods
    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`

- - ### Constructor Detail

    - #### public TimeDuration(int hours, int minutes, int seconds, int millis)

      Creates a time duration without a day component.

      Parameters:
        `hours` - the hour component
        `minutes` - the minute component
        `seconds` - the second component
        `millis` - the millisecond component

    - #### public TimeDuration(int days, int hours, int minutes, int seconds, int millis)

      Creates a time duration with an optional day component.

      Parameters:
        `days` - the day component
        `hours` - the hour component
        `minutes` - the minute component
        `seconds` - the second component
        `millis` - the millisecond component

  - ### Method Detail

    - #### public Date getAgo()

      Returns the date represented by this duration ago.

      Returns:
        the computed date

    - #### public From getFrom()

      Returns a helper for computing dates relative to now.

      Returns:
        the relative-date helper

    - #### public Duration minus(Duration rhs)

      Subtracts a fixed duration.

      Parameters:
        `rhs` - the duration to subtract
      Returns:
        the resulting duration

    - #### public DatumDependentDuration minus(DatumDependentDuration rhs)

      Subtracts a datum-dependent duration.

      Parameters:
        `rhs` - the duration to subtract
      Returns:
        the resulting duration

    - #### public Duration plus(Duration rhs)

      Adds a fixed duration.

      Parameters:
        `rhs` - the duration to add
      Returns:
        the combined duration

    - #### public DatumDependentDuration plus(DatumDependentDuration rhs)

      Adds a datum-dependent duration.

      Parameters:
        `rhs` - the duration to add
      Returns:
        the combined duration