TimeOfDay class

A time on a day in 24-hour format. Used in a ScheduledTrigger.

Follows the conventions in the DateTime class, but only uses the Time part in a 24 hour time format.

Annotations
  • @JsonSerializable.new(includeIfNull: false, explicitToJson: true)

Constructors

TimeOfDay({int hour = 0, int minute = 0, int second = 0})
Constructs an instance of TimeOfDay.
const
TimeOfDay.fromDateTime(DateTime time)
Creates a TimeOfDay based on the given time.
TimeOfDay.fromJson(Map<String, dynamic> json)
factory
TimeOfDay.now()
Constructs a TimeOfDay instance with current time in the local time zone.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
hour → int
The hour in 24 hour format.
final
minute → int
The minute 0-59.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
second → int
The second 0-59.
final

Methods

difference(TimeOfDay other) → Duration
Returns a Duration with the difference when subtracting other from this.
isAfter(TimeOfDay other) → bool
Returns true if this occurs after other.
isBefore(TimeOfDay other) → bool
Returns true if this occurs before other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
Output as ISO 8601 extended time format with seconds accuracy, omitting the 24th hour and 60th leap second. E.g., "09:30:00".
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited