Package csw.time.core.models
Class UTCTime
java.lang.Object
csw.time.core.models.UTCTime
- All Implemented Interfaces:
TMTTime
,Serializable
,scala.Equals
,scala.Product
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 Summary
-
Method Summary
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
Methods inherited from interface csw.time.core.models.TMTTime
currentInstant, durationFromNow
-
Constructor Details
-
UTCTime
-
-
Method Details
-
now
Obtains the PTP (Precision Time Protocol) synchronized current UTC time. In case of a Linux machine, this will make a native callclock_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
-
value
-
toTAI
Converts theUTCTime
toTAITime
by adding the UTC-TAI offset. UTC-TAI offset is fetched by doing a native call tontp_gettimex
. It ensures to get the latest offset as updated by the PTP Grandmaster.- Returns:
- TAI time at the given UTC time
-