UTCScale

org.abh80.nf.core.time.UTCScale
See theUTCScale companion object
class UTCScale(tai: TimeScale, leapOffsets: Array[LeapSecondOffset]) extends TimeScale

Implements the UTC (Coordinated Universal Time) time scale, including leap second handling.

This class provides conversion between TAI (International Atomic Time) and UTC, accounting for historical and current leap second definitions. It maintains a list of leap second offsets and computes the appropriate offset for any given time.

Value parameters

leapOffsets

The leap offsets after Jan 1. 2017. Likely to be deprecated after 2035, since the leap seconds will be dropped by then.

tai

The TAI time scale instance used as a reference for conversions.

Attributes

See also
Example
                  val leapOffsets = Array(
                    LeapSecondOffset(Date(2024, 1, 1), 0, 38, 0),
                    LeapSecondOffset(Date(2025, 7, 1), 0, 39, 0)
                  )
                  val scale = UTCScale(TimeScaleFactory.getTAI, leapOffsets)
Companion
object
Graph
Supertypes
trait TimeScale
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def getLeap(time: AbsoluteTime): TimeFormat

Retrieves the leap second adjustment for the given absolute time.

Retrieves the leap second adjustment for the given absolute time.

Attributes

Definition Classes
override def isInsideLeapSecond(time: AbsoluteTime): Boolean

Determines if a given absolute time falls within a leap second.

Determines if a given absolute time falls within a leap second.

For time scales that don't use leap seconds (like TAI), this always returns false. For UTC, this would return true during leap second events.

Attributes

Definition Classes
override def minuteDuration(time: AbsoluteTime): Int

Duration of a minute in seconds. Default is 60 seconds for most time scales. May differ for specialized astronomical time scales.

Duration of a minute in seconds. Default is 60 seconds for most time scales. May differ for specialized astronomical time scales.

Attributes

Definition Classes
override def timePastTAI(time: AbsoluteTime): TimeFormat

Calculates the difference between this time scale and TAI at the given time.

Calculates the difference between this time scale and TAI at the given time.

Attributes

Definition Classes
override def timeToTAI(date: Date, time: Time): TimeFormat

Converts a date and time in this scale to the equivalent TAI time.

Converts a date and time in this scale to the equivalent TAI time.

This method iteratively converges on the correct offset using the timePastTAI function. It typically requires 3-4 iterations to converge with sufficient accuracy.

Attributes

Definition Classes

Inherited methods

Returns the most recent leap second adjustment applied to this time scale.

Returns the most recent leap second adjustment applied to this time scale.

For time scales without leap seconds, this returns zero.

Attributes

Returns

The most recent leap second adjustment as a TimeFormat

Inherited from:
TimeScale
def getName: String

Gets the identifying name of this time scale.

Gets the identifying name of this time scale.

Attributes

Returns

The name of this time scale (e.g., "UTC", "TAI", "TT")

Inherited from:
TimeScale
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
TimeScale -> Any
Inherited from:
TimeScale