Instant class

An instant with a timestamp.

Inheritance
Annotations
  • @immutable

Constructors

Instant(DateTime time)
Creates an instant with a time stamp.
const
Instant.parse(String text)
Creates an instant from a string.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
isUtc bool
True if this temporal object is set to UTC time.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
time DateTime
The time stamp of this instant.
no setter

Methods

copyWith({DateTime? time}) Instant
Copy this instant with an optional time changed.
isAfterTime(DateTime time) bool
Returns true if this occurs fully after time.
override
isBeforeTime(DateTime time) bool
Returns true if this occurs fully before time.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this temporal object.
override
toUtc() Instant
Returns this temporal object in the UTC time zone.
override

Operators

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

Static Methods

tryParse(String text) Instant?
Creates an instant from a string or returns null if cannot parse.