Time class abstract
Represents a fixed (and calendar-independent) length of time.
A Time is a fixed length of time defined by an integral number of nanoseconds. Although Times are usually used with a positive number of nanoseconds, negative Times are valid, and may occur naturally when e.g. subtracting an earlier Instant from a later one.
A Time represents a fixed length of elapsed time along the time line that occupies the same amount of time regardless of when it is applied. In contrast, Period represents a period of time in calendrical terms (years, months, days, and so on) that may vary in elapsed time when applied.
In general, use Time to represent durations applied to global types like Instant and ZonedDateTime; use Period to represent a period applied to local types like LocalDateTime.
The range of valid values of a Time is greater than the span of time supported by Time Machine - so for example, subtracting one Instant from another will always give a valid Time.
This type is immutable.
- Implemented types
- Annotations
-
- @immutable
Constructors
Properties
- canNanosecondsBeInteger → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hourOf12HourClock → int
-
Gets the hour of the half-day of this local time, in the range 1 to 12 inclusive.
no setter
- hourOfDay → int
-
no setter
- inDays → int
-
no setter
- inHours → int
-
no setter
- inMicroseconds → int
-
no setter
- inMilliseconds → int
-
no setter
- inMinutes → int
-
no setter
- inNanoseconds → int
-
no setter
- inNanosecondsAsBigInt → BigInt
-
no setter
- inSeconds → int
-
no setter
- isNegative → bool
-
no setter
- microsecondOfSecond → int
-
no setter
- millisecondOfSecond → int
-
no setter
- minuteOfHour → int
-
no setter
- nanosecondOfSecond → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondOfMinute → int
-
no setter
- toDuration → Duration
-
no setter
- totalDays → double
-
no setter
- totalHours → double
-
no setter
- totalMicroseconds → double
-
no setter
- totalMilliseconds → double
-
no setter
- totalMinutes → double
-
no setter
- totalNanoseconds → double
-
no setter
- totalSeconds → double
-
no setter
Methods
-
abs(
Time other) → Time -
add(
Time other) → Time -
compareTo(
Time? other) → int -
Compares this object to another object.
override
-
divide(
num factor) → Time -
equals(
Time other) → bool -
multiply(
num factor) → Time -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subtract(
Time other) → Time -
toString(
[String? patternText, Culture? culture]) → String -
A string representation of this object.
override
Operators
-
operator *(
num factor) → Time -
operator +(
Time other) → Time -
operator -(
Time other) → Time -
operator /(
num quotient) → Time -
operator <(
Time other) → bool -
operator <=(
Time other) → bool -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Time other) → bool -
operator >=(
Time other) → bool -
operator unary-(
) → Time