Timestamp class

Represents a point in time with nanosecond precision.

Parameters:

Returns: A Timestamp instance.

Example:

var ts = Timestamp(1609459200, 0); // 2021-01-01 00:00:00
Implemented types

Constructors

Timestamp(int secondsSinceEpoch, int nanosecondsSinceEpoch)
Timestamp.fromDate(DateTime date)
Creates a Timestamp from a DateTime.
factory
Timestamp.fromMicrosecondsSinceEpoch(int microseconds)
Creates a Timestamp from microseconds since epoch.
factory
Timestamp.fromMillisecondsSinceEpoch(int milliseconds)
Creates a Timestamp from milliseconds since epoch.
factory
Timestamp.fromTimestampString(String str)
Creates a Timestamp from an ISO 8601 string.
factory
Timestamp.now()
Creates a Timestamp for the current time.
factory

Properties

hashCode → int
Gets a hash code.
no setteroverride
microsecondsSinceEpoch → int
Gets microseconds since epoch.
no setter
millisecondsSinceEpoch → int
Gets milliseconds since epoch.
no setter
nanoseconds → int
Gets the nanoseconds since epoch.
no setter
nanosecondsSinceEpoch → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
seconds → int
Gets the seconds since epoch.
no setter
secondsSinceEpoch → int
final

Methods

compareTo(Timestamp other) → int
Compares this Timestamp to another.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDate() → DateTime
Converts to a DateTime in UTC.
toString() → String
Returns the timestamp string.
override
toTimestampString() → String
Converts to an ISO 8601 string with microseconds.

Operators

operator ==(Object other) → bool
Checks equality with another Timestamp.
override