Class NetworkTimestamp.NetworkTimestampDatetimeConverter

java.lang.Object
org.symbol.sdk.NetworkTimestamp.NetworkTimestampDatetimeConverter
Enclosing class:
NetworkTimestamp

public static final class NetworkTimestamp.NetworkTimestampDatetimeConverter extends Object
NetworkTimestampDatetimeConverter
Provides utilities for converting between network timestamps and datetimes.
  • Field Details

    • epoch

      public final Instant epoch
      Date at which network started.
    • timeUnits

      public final long timeUnits
      Number of milliseconds per time unit.
  • Constructor Details

  • Method Details

    • toDatetime

      public Instant toDatetime(long rawTimestamp)
      NetworkTimestampDatetimeConverter.toDatetime
      Converts a network timestamp to a datetime.
      Parameters:
      rawTimestamp - Raw network timestamp.
      Returns:
      Datetime representation of the network timestamp.
    • toDifference

      public long toDifference(Instant referenceDatetime)
      NetworkTimestampDatetimeConverter.toDifference
      Subtracts the network epoch from the reference date.
      Parameters:
      referenceDatetime - Reference date.
      Returns:
      Number of network time units between the reference date and the network epoch.