Time class

A Time represents the time of the day, independently of the day of the year, timezone or DateTime.

Implemented types

Constructors

Time(int hour, [int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
Time.fromBytes(List<int> bytes, {bool allowParseString = true})
Parses bytes to Time. See toBytes32 and toBytes64.
factory
Time.fromDateTime(DateTime dateTime)
Creates a Time instance from dateTime.
factory
Time.fromDuration(Duration duration)
Creates a Time instance from duration.
factory
Time.fromMicroseconds(int microseconds)
Creates a Time period instance from a total microseconds.
factory
Time.fromMilliseconds(int milliseconds)
Creates a Time period instance from a total milliseconds.
factory
Time.fromMinutes(int minutes)
Creates a Time period instance from a total minutes.
factory
Time.fromSeconds(int seconds)
Creates a Time period instance from a total seconds.
factory
Time.parse(String s, {bool allowFromBytes = true})
Parses s to Time.
factory

Properties

asDuration Duration
Converts this instance to Duration.
no setter
hashCode int
The hash code for this object.
no setteroverride
hour int
getter/setter pair
microsecond int
getter/setter pair
millisecond int
getter/setter pair
minute int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
second int
getter/setter pair
totalMicrosecond int
Returns the total microsecond of this Time period.
no setter
totalMilliseconds int
Returns the total milliseconds of this Time period.
no setter
totalMinutes int
Returns the total minutes of this Time period.
no setter
totalSeconds int
Returns the total seconds of this Time period.
no setter

Methods

compareTo(Time other) int
Compares this object to another object.
override
copyWith({int? hour, int? minute, int? second, int? millisecond, int? microsecond}) Time
Creates a new Time from this one by updating individual properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBytes32() Uint8List
Converts this to 32-bits bytes (Uint8List), encoding totalMilliseconds.
toBytes64() Uint8List
Converts this to 64-bits bytes (Uint8List), encoding totalMicrosecond.
toDateTime(int year, [int month = 1, int day = 1, bool utc = true]) DateTime
Converts this Time to DateTime.
toString({bool withSeconds = true, bool? withMillisecond, bool? withMicrosecond}) String
A string representation of this object.
override

Operators

operator <(Time other) → dynamic
operator <=(Time other) → dynamic
operator ==(Object other) bool
The equality operator.
override
operator >(Time other) → dynamic
operator >=(Time other) → dynamic

Static Methods

boot() → void
from(Object? o) Time?