Top Description Classes
[default module]

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
groovy.time.TimeCategory

Class Summary

Modifier and TypeClass and Description
public abstract class
BaseDuration

Base class for date and time durations.

public class
DatumDependentDuration

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

public class
Duration

Duration represents time periods which have values independent of the context.

public class
TimeCategory

Apply a number of methods to allow convenient Date/Time manipulation,such as:

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

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

TimeDatumDuration represents a time period which results from an arithmetic operation between a TimeDuration object and a DatumDuration object

public class
TimeDuration

TimeDuration represents time periods expressed in units of hours, minutes, seconds and milliseconds.