Timestamp class
Utilities for safely handling timestamps beyond the 32-bit epoch range.
Timestamp provides conversion between DateTime and safe millisecond representations, handling rollover for dates that would overflow a 32-bit signed integer when expressed as milliseconds since the Unix epoch.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getSafeTimestamp(
DateTime dateTime) → int -
Returns the safe milliseconds-since-epoch representation of
dateTime. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- maxDateTime ↔ DateTime
-
The maximum DateTime that can be safely represented.
getter/setter pair
Static Methods
-
fromSafeMillisecondsSinceEpoch(
int milliseconds, {DateTime? current}) → DateTime - Converts a safe milliseconds-since-epoch value back into a DateTime.