TimeOfDay
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(includeIfNull: false, explicitToJson: true)
Constructors
TimeOfDay.fromDateTime
- DateTime time
Creates a TimeOfDay based on the given time.
TimeOfDay.fromJson
TimeOfDay
Constructs an instance of TimeOfDay.
TimeOfDay.now
Constructs a TimeOfDay instance with current time in the local time zone.
Properties
hour
The hour in 24 hour format (0-23).
minute
The minute 0-59.
second
The second 0-59.
Methods
difference
Returns a Duration with the difference when subtracting other from this time.
The returned Duration will be negative if other occurs after this time.
isAfter
Returns true if this time occurs after other.
The comparison is independent of whether the time is in UTC or in the local time zone.
isBefore
Returns true if this time occurs before other.
The comparison is independent of whether the time is in UTC or in the local time zone.
toJson
toString
Output as ISO 8601 extended time format with seconds accuracy, omitting the 24th hour and 60th leap second. E.g., "09:30:00".