Class Timestamp


  • public final class Timestamp
    extends java.lang.Object
    Represents a single instant in time. Ideally, we'd use java.time.Instant, but we cannot do so until we move to API level 26.
    • 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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object