# Package groovy.time

package groovy.time

Classes for easily manipulating Dates and times. While `java.util.Date` has GDK methods for adding or subtracting days, this is not so useful for different durations of time. `TimeCategory` creates a simple internal DSL for manipulating dates and times in a clean and precise fashion.

### Examples

      use ( TimeCategory ) {
            // application on numbers:
            println 1.minute.from.now
            println 10.days.ago

            // application on dates
            def someDate = new Date()
            println someDate - 3.months
      }

See Also:
  - `TimeCategory`

- Class
  Description
  BaseDuration
  Deprecated.
  Superseded by the quirk-free DSLs: `org.apache.groovy.dateutil.TimeCategory` (and its `java.util.Date`-based duration classes) or `org.apache.groovy.datetime.TimeCategory` (producing `java.time` types).
  BaseDuration.From
  Helper for computing dates relative to the current time.
  DatumDependentDuration
  Deprecated.
  Superseded by `org.apache.groovy.dateutil.DatumDependentDuration` (the dequirked `java.util.Date` flavor) or `java.time.Period`.
  Duration
  Deprecated.
  Superseded by `org.apache.groovy.dateutil.Duration` (the dequirked `java.util.Date` flavor) or `java.time.Duration`/`java.time.Period`.
  TimeCategory
  Deprecated.
  Use one of the quirk-free replacements instead: `org.apache.groovy.datetime.TimeCategory` (produces `java.time` types) or `org.apache.groovy.dateutil.TimeCategory` (produces `java.util.Date`).
  Timed<T>
  An immutable holder for the outcome of a timed execution: the value produced together with the elapsed time in nanoseconds.
  TimeDatumDependentDuration
  Deprecated.
  Superseded by `org.apache.groovy.dateutil.TimeDatumDependentDuration` (the dequirked `java.util.Date` flavor) or the `java.time` DSL in `org.apache.groovy.datetime.TimeCategory`.
  TimeDuration
  Deprecated.
  Superseded by `org.apache.groovy.dateutil.TimeDuration` (the dequirked `java.util.Date` flavor) or `java.time.Duration`.