Class UTCTime

  • All Implemented Interfaces:
    TMTTime, java.io.Serializable, scala.Equals, scala.Product

    public final class UTCTime
    extends java.lang.Object
    implements TMTTime, scala.Product, java.io.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      UTCTime​(java.time.Instant value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UTCTime after​(scala.concurrent.duration.FiniteDuration duration)  
      static UTCTime now()
      Obtains the PTP (Precision Time Protocol) synchronized current UTC time.
      TAITime toTAI()
      Converts the UTCTime to TAITime by adding the UTC-TAI offset.
      java.time.Instant value()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface scala.Equals

        canEqual, equals
      • Methods inherited from interface scala.Product

        productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
    • Constructor Detail

      • UTCTime

        public UTCTime​(java.time.Instant value)
    • Method Detail

      • 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 java.time.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