PreciseDateTime class
DateTime considering the microseconds on any platform, including Web.
- Inheritance
- Implemented types
- Annotations
Constructors
- PreciseDateTime(DateTime val, {int microsecond = 0})
-
PreciseDateTime.fromJson(Map<
String, dynamic> json) -
Constructs a PreciseDateTime from the provided
json
.factory - PreciseDateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch)
-
Constructs a new PreciseDateTime instance with the given
microsecondsSinceEpoch
.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- microsecond → int
-
Microsecond part of this PreciseDateTime.
final
- microsecondsSinceEpoch → int
-
Returns the number of microseconds since the "Unix epoch"
1970-01-01T00:00:00Z (UTC).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- val → DateTime
-
Actual value wrapped by this NewType.
finalinherited
Methods
-
add(
Duration duration) → PreciseDateTime -
Returns a new PreciseDateTime instance with
duration
added. -
compareTo(
PreciseDateTime other) → int -
Compares this object to another object.
override
-
isAfter(
PreciseDateTime other) → bool -
Returns
true
if this PreciseDateTime occurs afterother
. -
isBefore(
PreciseDateTime other) → bool -
Returns
true
if this PreciseDateTime occurs beforeother
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subtract(
Duration duration) → PreciseDateTime -
Returns a new PreciseDateTime instance with
duration
subtracted from this PreciseDateTime. -
toJson(
) → Map< String, dynamic> - Returns a Map representing this PreciseDateTime.
-
toString(
) → String -
A string representation of this object.
override
-
toUtc(
) → PreciseDateTime - Returns this PreciseDateTime value in the UTC time zone.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
now(
) → PreciseDateTime - Constructs a PreciseDateTime instance with current date and time in the local time zone.
-
parse(
String formattedString) → PreciseDateTime -
Constructs a new PreciseDateTime instance based on
formattedString
.