Class UTCTime

java.lang.Object
csw.time.core.models.UTCTime
All Implemented Interfaces:
TMTTime, Serializable, scala.Equals, scala.Product

public final class UTCTime extends Object implements TMTTime, scala.Product, Serializable
Represents an instantaneous point in time in the UTC scale. Does not contain zone information. To represent this instance in various zones, use TMTTimeHelper.

param: value the underlying java.time.Instant

See Also:
  • Constructor Details

    • UTCTime

      public UTCTime(Instant value)
  • Method Details

    • now

      public static UTCTime now()
      Obtains the PTP (Precision Time Protocol) synchronized current UTC time. In case of a Linux machine, this will make a native call clock_gettime inorder to get time from the system clock with nanosecond precision. In case of all the other operating systems, nanosecond precision is not supported, hence no native call is made.

      Returns:
      current time in UTC scale
    • after

      public static UTCTime after(scala.concurrent.duration.FiniteDuration duration)
    • value

      public Instant value()
      Specified by:
      value in interface TMTTime
    • toTAI

      public TAITime toTAI()
      Converts the UTCTime to TAITime by adding the UTC-TAI offset. UTC-TAI offset is fetched by doing a native call to ntp_gettimex. It ensures to get the latest offset as updated by the PTP Grandmaster.

      Returns:
      TAI time at the given UTC time