$DateTime class

dart_eval $Instance wrapper of a DateTime

Implemented types
Available extensions

Constructors

$DateTime.wrap(DateTime $value)
Wrap a DateTime in a $DateTime

Properties

$reified → DateTime
Fully reify the underlying value so it can be used in a Dart context. For example, recursively transform collections into their underlying $values.
no setteroverride
$value → DateTime
The backing Dart value of this $Value.
final
day → int
The day of the month [1..31].
no setteroverride
hashCode → int
The hash code for this object.
no setteroverride
hour → int
The hour of the day, expressed as in a 24-hour clock [0..23].
no setteroverride
isUtc → bool
True if this DateTime is set to UTC time.
no setteroverride
microsecond → int
The microsecond [0...999].
no setteroverride
microsecondsSinceEpoch → int
The number of microseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
millisecond → int
The millisecond [0...999].
no setteroverride
millisecondsSinceEpoch → int
The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
minute → int
The minute [0...59].
no setteroverride
month → int
The month [1..12].
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
second → int
The second [0...59].
no setteroverride
timeZoneName → String
The time zone name.
no setteroverride
timeZoneOffset → Duration
The time zone offset, which is the difference between local time and UTC.
no setteroverride
weekday → int
The day of the week monday..sunday.
no setteroverride
year → int
The year.
no setteroverride

Methods

$getProperty(Runtime runtime, String identifier) → $Value?
Get a property by identifier on this instance
override
$getRuntimeType(Runtime runtime) → int
Index of the class Type in the runtime dictionary. By definition can change from run to run, so it's customary to use Runtime.lookupType in implementations.
override
$setProperty(Runtime runtime, String identifier, $Value value) → void
Set a property by identifier on this instance to value
override
add(Duration duration) → DateTime
Returns a new DateTime instance with duration added to this DateTime.
override
compareTo(DateTime other) → int
Compares this DateTime object to other, returning zero if the values are equal.
override
copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond, bool? isUtc}) → DateTime

Available on DateTime, provided by the DateTimeCopyWith extension

Creates a new DateTime from this one by updating individual properties.
difference(DateTime other) → Duration
Returns a Duration with the difference when subtracting other from this DateTime.
override
isAfter(DateTime other) → bool
Whether this DateTime occurs after other.
override
isAtSameMomentAs(DateTime other) → bool
Whether this DateTime occurs at the same moment as other.
override
isBefore(DateTime other) → bool
Whether this DateTime occurs before other.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subtract(Duration duration) → DateTime
Returns a new DateTime instance with duration subtracted from this DateTime.
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

Static Methods

$new(Runtime runtime, $Value? target, List<$Value?> args) → $DateTime
$parse(Runtime runtime, $Value? target, List<$Value?> args) → $Value?
$tryParse(Runtime runtime, $Value? target, List<$Value?> args) → $Value?
configureForRuntime(Runtime runtime) → void
Configure the $DateTime class for runtime with a Runtime

Constants

$declaration → const BridgeClassDef
Compile-time class declaration for $DateTime