ConstDateTime class Null safety

Implemented types

Constructors

ConstDateTime(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
const
ConstDateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch, {bool isUtc = false})
const
ConstDateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, {bool isUtc = false})
const
ConstDateTime.utc(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0])
const

Properties

dateTime DateTime
read-only
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
isUtc bool
True if this DateTime is set to UTC time.
read-only, override
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
timeZoneName String
The time zone name.
read-only, override
timeZoneOffset Duration
The time zone offset, which is the difference between local time and UTC.
read-only, override
weekday int
The day of the week monday..sunday.
read-only, override
year int
The year.
read-only, override

Methods

add(Duration duration) DateTime
Returns a new DateTime instance with duration added to this.
override
compareTo(DateTime other) int
Compares this DateTime object to other, returning zero if the values are equal.
override
difference(DateTime other) Duration
Returns a Duration with the difference when subtracting other from this.
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.
override
subtract(Duration duration) DateTime
Returns a new DateTime instance with duration subtracted from this.
override
toIso8601String() String
Returns an ISO-8601 full-precision extended format representation.
override
toLocal() DateTime
Returns this DateTime value in the local time zone.
override
toString() String
A string representation of this object.
inherited
toUtc() DateTime
Returns this DateTime value in the UTC time zone.
override

Operators

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