An abstract moment in time (like 4pm, October 21. 2012).

DateTime does not contain a time zone information, so You can not use it to record or schedule events.

no type hierarchy

hashSource Codeshared actual default Integer hash

Implementation compatible with equals() method.

This implementation respect the constraint that if x==y then x.hash==y.hash.

Refines Object.hash
Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: DateTimeBehavior<Element,DateType,TimeType>
Attributes inherited from: Enumerable<Other>
Attributes inherited from: Ordinal<Other>
Attributes inherited from: ReadableDate
Attributes inherited from: ReadableMonth
Attributes inherited from: ReadableTime
Attributes inherited from: ReadableYear
equalsSource Codeshared actual default Boolean equals(Object other)

Two DateTimes are considered equals if they represent the same Date and Time.

instantSource Codeshared formal Instant instant(TimeZone timeZone = ...)

Returns an instant from this DateTime.

  • timeZone = tz.system
minusSource Codeshared formal DateTime minus(ReadablePeriod period)

Subtracts a specified period to this date and time.

periodFromSource Codeshared formal Period periodFrom(DateTime start)

Returns the period between this and the given DateTime.

If this date is before the given date then return zero period.

periodToSource Codeshared formal Period periodTo(DateTime end)

Returns the period between this and the given DateTime.

If this DateTime is after the given DateTime then return zero period.

plusSource Codeshared formal DateTime plus(ReadablePeriod period)

Adds a specified period to this date and time.

rangeToSource Codeshared formal DateTimeRange rangeTo(DateTime other)

Returns the DateTimeRange between this and given DateTime.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Comparable<Other>
Methods inherited from: DateBehavior<Element>
Methods inherited from: Enumerable<Other>
Methods inherited from: MonthBehavior<Element>
Methods inherited from: TimeBehavior<Element>
Methods inherited from: YearBehavior<Element>