TimeOnly class

Represents a time of day, as would be read from a clock, within the range 00:00:00 to 23:59:59.999999.

Implemented types

Constructors

TimeOnly(int hour, int minute, int second, int microsecond)
Constructs a TimeOnly from the individual components. Throws RangeError if any component is outside of its valid range.
TimeOnly.fromDateTime(DateTime source)
Constructs a TimeOnly from DateTime by disregarding the date component.
TimeOnly.fromDuration(Duration source)
Constructs a TimeOnly from Duration.
TimeOnly.fromJson(String json)
Deserializes a string into TimeOnly

Properties

hashCode int
The hash code for this object.
no setteroverride
hour int
Hour part of the time in the range [0; 24).
final
microsecond int
Microsecond part of the time in the range [0; 1000000).
final
minute int
Minute part of the time in the range [0; 60).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
second int
Second part of the time in the range [0; 60).
final

Methods

compareTo(TimeOnly other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDuration() Duration
Constructs a Duration representation of TimeOnly.
toJson() String
Serializes TimeOnly to a string.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override