Package groovy.time

# Class DatumDependentDuration

java.lang.Object
groovy.time.BaseDuration
groovy.time.DatumDependentDuration

All Implemented Interfaces:
  `Comparable<BaseDuration>`

Direct Known Subclasses:
  `TimeDatumDependentDuration`

@Deprecated public class DatumDependentDuration extends BaseDuration
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.
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)

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class groovy.time.BaseDuration

  `BaseDuration.From`

- ## Field Summary

  ### Fields inherited from class groovy.time.BaseDuration

  `days, hours, millis, minutes, months, seconds, years`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Date`
  `getAgo()`
  Deprecated.
  Returns the date represented by this duration ago.
  `BaseDuration.From`
  `getFrom()`
  Deprecated.
  Returns a helper for computing dates relative to now.
  `int`
  `getMonths()`
  Deprecated.
  Returns the month component.
  `int`
  `getYears()`
  Deprecated.
  Returns the year component.
  `DatumDependentDuration`
  `minus(DatumDependentDuration rhs)`
  Deprecated.
  Subtracts another datum-dependent duration.
  `DatumDependentDuration`
  `minus(Duration rhs)`
  Deprecated.
  Subtracts a fixed duration.
  `DatumDependentDuration`
  `plus(DatumDependentDuration rhs)`
  Deprecated.
  Adds another datum-dependent duration.
  `DatumDependentDuration`
  `plus(Duration rhs)`
  Deprecated.
  Adds a fixed duration.
  `DatumDependentDuration`
  `plus(TimeDatumDependentDuration rhs)`
  Deprecated.
  Adds a mixed time and datum-dependent duration.
  `DatumDependentDuration`
  `plus(TimeDuration rhs)`
  Deprecated.
  Adds a time duration.
  `long`
  `toMilliseconds()`
  Deprecated.
  Converts this duration to milliseconds.

  ### Methods inherited from class groovy.time.BaseDuration

  `compareTo, getDays, getHours, getMillis, getMinutes, getSeconds, plus, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DatumDependentDuration

    public DatumDependentDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)
    Deprecated.
    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 Details

  - ### getMonths

    public int getMonths()
    Deprecated.
    Returns the month component.
    Overrides:
      `getMonths` in class `BaseDuration`
    Returns:
      the month component

  - ### getYears

    public int getYears()
    Deprecated.
    Returns the year component.
    Overrides:
      `getYears` in class `BaseDuration`
    Returns:
      the year component

  - ### plus

    public DatumDependentDuration plus(DatumDependentDuration rhs)
    Deprecated.
    Adds another datum-dependent duration.
    Parameters:
      `rhs` - the duration to add
    Returns:
      the combined duration

  - ### plus

    public DatumDependentDuration plus(TimeDatumDependentDuration rhs)
    Deprecated.
    Adds a mixed time and datum-dependent duration.
    Parameters:
      `rhs` - the duration to add
    Returns:
      the combined duration

  - ### plus

    public DatumDependentDuration plus(Duration rhs)
    Deprecated.
    Adds a fixed duration.
    Parameters:
      `rhs` - the duration to add
    Returns:
      the combined duration

  - ### plus

    public DatumDependentDuration plus(TimeDuration rhs)
    Deprecated.
    Adds a time duration.
    Parameters:
      `rhs` - the duration to add
    Returns:
      the combined duration

  - ### minus

    public DatumDependentDuration minus(DatumDependentDuration rhs)
    Deprecated.
    Subtracts another datum-dependent duration.
    Parameters:
      `rhs` - the duration to subtract
    Returns:
      the resulting duration

  - ### minus

    public DatumDependentDuration minus(Duration rhs)
    Deprecated.
    Subtracts a fixed duration.
    Parameters:
      `rhs` - the duration to subtract
    Returns:
      the resulting duration

  - ### toMilliseconds

    public long toMilliseconds()
    Deprecated.
    Description copied from class: `BaseDuration`
    Converts this duration to milliseconds.
    Specified by:
      `toMilliseconds` in class `BaseDuration`
    Returns:
      the duration in milliseconds
    See Also:
      - `Change the duration into milliseconds, relative to 'now.' Therefore things like timezone and time of year will affect how this conversion occurs.`

  - ### getAgo

    public Date getAgo()
    Deprecated.
    Returns the date represented by this duration ago.
    Specified by:
      `getAgo` in class `BaseDuration`
    Returns:
      the computed date

  - ### getFrom

    public BaseDuration.From getFrom()
    Deprecated.
    Returns a helper for computing dates relative to now.
    Specified by:
      `getFrom` in class `BaseDuration`
    Returns:
      the relative-date helper