Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## groovy.time
Class TimeDuration

    java.lang.Object
      groovy.time.BaseDuration
          groovy.time.Duration
              groovy.time.TimeDuration

    public class TimeDuration
    extends Duration

TimeDuration represents time periods expressed in units of hours, minutes, seconds and milliseconds. Whilst we can't say how long a month is without knowing the year and the name of the month, we know how long a second is independent of the date.

This is not 100% true for minutes. Minutes can be 59, 60 or 61 seconds long (due to leap seconds.) If you ask Duration to convert itself to milliseconds then it will work on the basis of 60 seconds in a minute. If you add or subtract it from a date it will take leap seconds into account.

Author:
  John Wilson tug@wilson.co.uk

Nested Class Summary
Modifier and Type | Class and Description
--- | ---

Nested classes/interfaces inherited from class groovy.time.BaseDuration
`BaseDuration.From`

Field Summary
Modifier and Type | Field and Description
--- | ---

Fields inherited from class groovy.time.BaseDuration
`days, hours, millis, minutes, months, seconds, years`

Constructor Summary
Constructor and Description
`TimeDuration(int hours, int minutes, int seconds, int millis)`
`TimeDuration(int days, int hours, int minutes, int seconds, int millis)`

Method Summary
Modifier and Type | Method and Description
--- | ---
`Date` | `getAgo()`
`BaseDuration.From` | `getFrom()`
`DatumDependentDuration` | `minus(DatumDependentDuration rhs)`
`Duration` | `minus(Duration rhs)`
`DatumDependentDuration` | `plus(DatumDependentDuration rhs)`
`Duration` | `plus(Duration rhs)`

Methods inherited from class groovy.time.Duration
`minus, minus, plus, toMilliseconds`

Methods inherited from class groovy.time.BaseDuration
`getDays, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TimeDuration

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

### TimeDuration

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

Method Detail

### plus

    public Duration plus(Duration rhs)

  Overrides:
    `plus` in class `Duration`

### plus

    public DatumDependentDuration plus(DatumDependentDuration rhs)

  Overrides:
    `plus` in class `Duration`

### minus

    public Duration minus(Duration rhs)

  Overrides:
    `minus` in class `Duration`

### minus

    public DatumDependentDuration minus(DatumDependentDuration rhs)

  Overrides:
    `minus` in class `Duration`

### getAgo

    public Date getAgo()

  Overrides:
    `getAgo` in class `Duration`

### getFrom

    public BaseDuration.From getFrom()

  Overrides:
    `getFrom` in class `Duration`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2003-2010 The Codehaus. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD