Package: groovy.time

## [Java] Class DatumDependentDuration

- groovy.time.DatumDependentDuration

-     @Deprecated
      public class DatumDependentDuration
      extends BaseDuration

  DatumDependentDuration represents durations whose length in milliseconds cannot be determined without knowing the datum point.

  I don't know how many days in a year unless I know if it's a leap year or not.

  I don't know how many days in a month unless I know the name of the month (and if it's a leap year if the month is February)

  deprecated:
    Superseded by `org.apache.groovy.dateutil.DatumDependentDuration` (the dequirked `java.util.Date` flavor) or `java.time.Period`. This legacy class is retained, unchanged, for backward compatibility.

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

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)` Creates a datum-dependent duration.

  - ### 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 int` | `getMonths()` * Returns the month component. * * Returns: the month component
    `` | `public int` | `getYears()` * Returns the year component. * * Returns: the year component
    `` | `public DatumDependentDuration` | `minus(DatumDependentDuration rhs)` Subtracts another datum-dependent duration.
    `` | `public DatumDependentDuration` | `minus(Duration rhs)` Subtracts a fixed duration.
    `` | `public DatumDependentDuration` | `plus(DatumDependentDuration rhs)` Adds another datum-dependent duration.
    `` | `public DatumDependentDuration` | `plus(TimeDatumDependentDuration rhs)` Adds a mixed time and datum-dependent duration.
    `` | `public DatumDependentDuration` | `plus(Duration rhs)` Adds a fixed duration.
    `` | `public DatumDependentDuration` | `plus(TimeDuration rhs)` Adds a time duration.
    `` | `public long` | `toMilliseconds()` See Also: BaseDuration.toMilliseconds

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BaseDuration` | `compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString`

- - ### Constructor Detail

    - #### public DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)

      Creates a datum-dependent duration.

      Parameters:
        `years` - the year component
        `months` - the month component
        `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 int getMonths()

      * Returns the month component. * *

      Returns:
        the month component

    - #### public int getYears()

      * Returns the year component. * *

      Returns:
        the year component

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

      Subtracts another datum-dependent duration.

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

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

      Subtracts a fixed duration.

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

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

      Adds another datum-dependent duration.

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

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

      Adds a mixed time and datum-dependent duration.

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

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

      Adds a fixed duration.

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

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

      Adds a time duration.

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

    - #### public long toMilliseconds()

      See Also: