Time class
A Time represents the time independent of whether it is in the UTC or local
timezone.
- Implemented types
- Annotations
-
- @immutable
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- hour → int
-
The hour.
final
- inMicroseconds → int
-
Returns
thisin microseconds.no setter - inMilliseconds → int
-
Returns
thisin milliseconds.no setter - microsecond → int
-
THe microsecond.
final
- millisecond → int
-
The millisecond.
final
- minute → int
-
The minute.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → int
-
The second.
final
Methods
-
compareTo(
Time other) → int -
Compares this object to another object.
override
-
difference(
Time other) → Duration -
Returns the difference between this and
other. -
from(
{DateTime? dateTime, int? seconds}) → Time - Returns Time from DateTime
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
now(
) → Time - Returns Time from DateTime.now()
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
Duration duration) → Time -
Adds the given
durationto this time. A RangeError is thrown if the resultant time is less than min or greater than max. -
operator -(
Duration duration) → Time -
Subtracts the given
durationfrom this time. A RangeError is thrown if the resultant time is less than min or greater than max. -
operator <(
Time other) → bool -
Returns
trueifthisis beforeotherandfalseotherwise. -
operator <=(
Time other) → bool -
Returns
trueifthisis before or the same asotherandfalseotherwise. -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Time other) → bool -
Returns
trueifthisis afterotherandfalseotherwise. -
operator >=(
Time other) → bool -
Returns
trueifthisis after or the same asotherandfalseotherwise.