Class Timestamp


  • public final class Timestamp
    extends Value
    A Timestamp value is represented as microseconds since the UNIX epoch.
    See Also:
    ValueOuterClass.Value.getTimestamp()
    • Constructor Detail

      • Timestamp

        public Timestamp​(long value)
        Constructs a Timestamp from a microsecond value.
        Parameters:
        value - The number of microseconds since UNIX epoch.
    • Method Detail

      • fromMillis

        public static @NonNull Timestamp fromMillis​(long millis)
        Constructs a Timestamp from milliseconds since UNIX epoch.
        Parameters:
        millis - milliseconds since UNIX epoch.
      • fromInstant

        public static @NonNull Timestamp fromInstant​(@NonNull java.time.Instant instant)
        Constructs a Timestamp value from an Instant up to microsecond precision. This is a lossy conversion as nanoseconds are not preserved.
      • getValue

        public @NonNull java.time.Instant getValue()
        This is an alias for toInstant()
        Returns:
        the microseconds stored in this timestamp
      • getMicroseconds

        public @org.checkerframework.checker.nullness.qual.NonNull long getMicroseconds()
      • toInstant

        public java.time.Instant toInstant()
        Returns:
        The point in time represented by this timestamp as Instant.
      • toProto

        public com.daml.ledger.api.v1.ValueOuterClass.Value toProto()
        Specified by:
        toProto in class Value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

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

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