Package com.android.identity
Class Timestamp
- java.lang.Object
-
- com.android.identity.Timestamp
-
public final class Timestamp extends java.lang.Object
Represents a single instant in time. Ideally, we'd usejava.time.Instant
, but we cannot do so until we move to API level 26.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
static Timestamp
now()
static Timestamp
ofEpochMilli(long epochMillis)
long
toEpochMilli()
java.lang.String
toString()
-
-
-
Method Detail
-
now
@NonNull public static Timestamp now()
- Returns:
- a
Timestamp
representing the current time
-
ofEpochMilli
@NonNull public static Timestamp ofEpochMilli(long epochMillis)
- Parameters:
epochMillis
- A time represented as the number of milliseconds since midnight, January 1, 1970 UTC- Returns:
- a
Timestamp
representing the given time
-
toEpochMilli
public long toEpochMilli()
- Returns:
- this represented as the number of milliseconds since midnight, January 1, 1970 UTC
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-