Time class
An immutable time without a timezone.
- Implemented types
- Mixed-in types
Constructors
- Time(int hour, [int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
- Creates a Time with the given time units.
- Time.fromMicroseconds(int microseconds)
-
Creates a Time from the given milliseconds. Behaviour is undefined if
microseconds
exceeds the total microseconds in a day.factory - Time.fromMilliseconds(int milliseconds)
-
Creates a Time from the given milliseconds. Behaviour is undefined if
milliseconds
exceeds the total milliseconds in a day.factory
Properties
- hash → int
-
The hashCode for this Relatable.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- hour → int
-
The hour.
final
- inMicroseconds → int
-
Represents this Time as microseconds.
no setter
- inMilliseconds → int
-
Represents this Time as milliseconds.
no setter
- inSeconds → int
-
Represents this Time as seconds.
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
-
ceil(
int value, TimeUnit unit) → Time -
Ceils this Time to the nearest
value
. -
compareTo(
Time other) → int -
Compares this object to another object.
override
-
difference(
Time other) → Duration -
Returns the length between this Time and
other
. -
floor(
int value, TimeUnit unit) → Time -
Floors this Time to the nearest
value
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
round(
int value, TimeUnit unit) → Time -
Rounds this Time to the nearest
value
. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
Duration duration) → Time - Returns a Time that represents this Time with the given duration added.
-
operator -(
Duration duration) → Time - Returns a Time that represents this Time with the given duration subtracted.
-
operator <(
Time other) → bool -
inherited
-
operator <=(
Time other) → bool -
inherited
-
operator ==(
dynamic other) → bool -
The equality operator.
inherited
-
operator >(
Time other) → bool -
inherited
-
operator >=(
Time other) → bool -
inherited