TZDateTime class Null safety

TimeZone aware DateTime

Implemented types

Constructors

TZDateTime(Location location, int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
Constructs a TZDateTime instance specified at location time zone. [...]
TZDateTime.from(DateTime other, Location location)
Constructs a new TZDateTime instance from the given DateTime in the specified location. [...]
TZDateTime.fromMicrosecondsSinceEpoch(Location location, int microsecondsSinceEpoch)
TZDateTime.fromMillisecondsSinceEpoch(Location location, int millisecondsSinceEpoch)
Constructs a new TZDateTime instance with the given millisecondsSinceEpoch. [...]
TZDateTime.local(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
Constructs a TZDateTime instance specified in the local time zone. [...]
TZDateTime.now(Location location)
Constructs a TZDateTime instance with current date and time in the location time zone. [...]
TZDateTime.utc(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
Constructs a TZDateTime instance specified in the UTC time zone. [...]

Properties

day int
The day of the month 1..31.
read-only, override
hashCode int
The hash code for this object. [...]
read-only, override
hour int
The hour of the day, expressed as in a 24-hour clock 0..23.
read-only, override
isLocal bool
True if this TZDateTime is set to Local time. [...]
read-only
isUtc bool
True if this TZDateTime is set to UTC time. [...]
read-only, override
location Location
Location
final
microsecond int
The microsecond 0...999.
read-only, override
microsecondsSinceEpoch int
The number of microseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC). [...]
read-only, override
millisecond int
The millisecond 0...999.
read-only, override
millisecondsSinceEpoch int
The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC). [...]
read-only, override
minute int
The minute 0...59.
read-only, override
month int
The month 1..12.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
second int
The second 0...59.
read-only, override
timeZone TimeZone
TimeZone
final
timeZoneName String
The abbreviated time zone name—for example, "CET" or "CEST".
read-only, override
timeZoneOffset Duration
The time zone offset, which is the difference between time at location and UTC. [...]
read-only, override
weekday int
The day of the week. [...]
read-only, override
year int
The year.
read-only, override

Methods

add(Duration duration) TZDateTime
Returns a new TZDateTime instance with duration added to this.
override
compareTo(DateTime other) int
Compares this TZDateTime object to other, returning zero if the values occur at the same moment. [...]
override
difference(DateTime other) Duration
Returns a Duration with the difference between this and other.
override
isAfter(DateTime other) bool
Returns true if this occurs after other. [...]
override
isAtSameMomentAs(DateTime other) bool
Returns true if this occurs at the same moment as other. [...]
override
isBefore(DateTime other) bool
Returns true if this occurs before other. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
subtract(Duration duration) TZDateTime
Returns a new TZDateTime instance with duration subtracted from this.
override
toIso8601String() String
Returns an ISO-8601 full-precision extended format representation. [...]
override
toLocal() TZDateTime
Returns this DateTime value in the local time zone. [...]
override
toString() String
Returns a human-readable string for this instance. [...]
override
toUtc() TZDateTime
Returns this DateTime value in the UTC time zone. [...]
override

Operators

operator ==(dynamic other) bool
Returns true if other is a TZDateTime at the same moment and in the same Location. [...]
override

Static Methods

parse(Location location, String formattedString) TZDateTime
Constructs a new TZDateTime instance based on formattedString. [...]
override

Constants

maxMillisecondsSinceEpoch → const int
Maximum value for time instants.
8640000000000000
minMillisecondsSinceEpoch → const int
Minimum value for time instants.
-maxMillisecondsSinceEpoch