Satisfied Interfaces: Comparable<DateTime>, DateBehavior<Element>, DateTimeBehavior<DateTime,Date,Time>, Enumerable<DateTime>, Ordinal<DateTime>, ReadableDate, ReadableDateTime, ReadableTime, TimeBehavior<Element>
Direct Known Satisfying Classes: GregorianDateTime

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.

Inherited Attributes
Attributes inherited from: Object
hash, string
Attributes inherited from: DateTimeBehavior<Element,DateType,TimeType>
Attributes inherited from: Enumerable<Other>
integerValue
Attributes inherited from: Ordinal<Other>
predecessor, successor
Attributes inherited from: ReadableDate
Attributes inherited from: ReadableTime
Methods
instantSource Code
shared formal Instant instant(TimeZone timeZone = ...)

Returns an instant from this DateTime.

Parameters:
  • timeZone = tz.system
minusSource Code
shared formal DateTime minus(ReadablePeriod period)

Subtracts a specified period to this date and time.

periodFromSource Code
shared 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 Code
shared 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 Code
shared formal DateTime plus(ReadablePeriod period)

Adds a specified period to this date and time.

rangeToSource Code
shared formal DateTimeRange rangeTo(DateTime other)

Returns the DateTimeRange between this and given DateTime.

Inherited Methods
Methods inherited from: Object
equals
Methods inherited from: Comparable<Other>
compare
Methods inherited from: DateBehavior<Element>
Methods inherited from: TimeBehavior<Element>