Class NanosecondConverter

java.lang.Object
com.influxdb.client.write.internal.NanosecondConverter

public final class NanosecondConverter extends Object
Nanosecond converter. Utility class converting epoch nanoseconds to epoch with a given precision.
  • Method Details

    • convert

      public static BigInteger convert(long millis, WritePrecision precision)
      Convert epoch timestamp (in millis) to a given precision.
      Parameters:
      millis - epoch timestamp in millis
      precision - precision
      Returns:
      epoch timestamp in precision
    • convert

      public static BigInteger convert(Instant instant, WritePrecision precision)
      Convert Instant timestamp to a given precision.
      Parameters:
      instant - Instant timestamp
      precision - precision
      Returns:
      epoch timestamp in precision
    • currentTimestamp

      public static BigInteger currentTimestamp(WritePrecision precision)
      Get current timestamp in a given precision.
      Parameters:
      precision - precision
      Returns:
      epoch timestamp in precision