DateTimeOffset class

A DateTime with a fixed offset

Implemented types

Constructors

DateTimeOffset(DateTime utcDateTime, int offsetInMinutes)
Constructs a DateTimeOffset from a UTC DateTime and a given offset in minutes. Assets that the given DateTime is UTC and the given offset is between -14h and 14h (inclusive)
DateTimeOffset.fromJson(String json)
Deserializes an ISO 8601 string into DateTimeOffset. If no timezone information is present, timestamp is interpreted as local time.
factory
DateTimeOffset.now()
DateTimeOffset at the current instant with local timezone.
factory

Properties

date DateOnly
The DateOnly when this instant occurred.
no setter
hashCode int
The hash code for this object.
no setteroverride
localDateTime DateTime
DateTimeOffset converted to local DateTime.
no setter
offset Duration
offsetInMinutes converted to Duration.
no setter
offsetInMinutes int
Offset in minutes from utcDateTime.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
time TimeOnly
The TimeOnly when this instant occurred.
no setter
utcDateTime DateTime
UTC DateTime.
final

Methods

compareTo(DateTimeOffset other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Serializes DateTimeOffset into a ISO 8601 timestamp.
toString() String
A string representation of this object.
override

Operators

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