org.abh80.nf.core.time
Members list
Type members
Classlikes
Represents an absolute point in time based on a given time format and timescale.
Represents an absolute point in time based on a given time format and timescale.
Internally, time is represented as a TimeFormat (seconds + attoseconds) relative to the J2000 epoch (January 1, 2000, 12:00 TT).
==Mathematical Background==
- The J2000 epoch is defined as JD 2451545.0 TT (Julian Date).
- Conversion between calendar date and J2000 offset is done by:
seconds = (days_since_J2000 * 86400) + time_of_day_seconds
- Leap seconds and timescale offsets (e.g., UTC → TAI → TT) are applied using TimeScale transformations.
Value parameters
- tf
-
the underlying time format instance used to represent the absolute time
Attributes
- See also
-
TimeFormat
TimeScale
- Companion
- object
- Supertypes
-
class TimeFormattrait Serializabletrait Comparable[TimeFormat]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AbsoluteTime.type
A robust date implementation that handles dates in different calendar systems.
A robust date implementation that handles dates in different calendar systems.
This class provides functionality to work with dates across three calendar systems:
- Gregorian calendar (current standard calendar system)
- Julian calendar (historical calendar used before Gregorian)
- Proleptic Julian calendar (extension of Julian calendar for dates before year 1)
The implementation uses J2000 day number as internal representation, which counts days from January 1, 2000 (known as the J2000 epoch in astronomy).
The class automatically handles calendar transitions:
- Before year 1: Proleptic Julian calendar
- Years 1-1582: Julian calendar
- After October 4, 1582: Gregorian calendar
Attributes
- Note
-
This class is immutable and thread-safe
it's recommended to initialize this class from the
Date
companion object - Companion
- object
- Supertypes
Factory methods for creating Date
instances.
Factory methods for creating Date
instances.
This companion object provides various apply
methods to construct Date
objects using different date components and epoch references. These methods offer flexibility in creating Date
instances from J2000 offsets, year/month/day combinations, or year/day-of-year combinations.
Attributes
Factory object providing commonly used epoch reference dates in astronomy and time systems.
Factory object providing commonly used epoch reference dates in astronomy and time systems.
This object contains predefined epoch dates that are frequently used in astronomical calculations and various time reference systems. These epochs serve as reference points for different time scales and coordinate systems.
Attributes
- See also
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
EpochFactory.type
A time scale that applies a fixed offset to TAI.
A time scale that applies a fixed offset to TAI.
Value parameters
- name
-
The name of this time scale.
- offset
-
The fixed offset to apply to TAI. This offset represents the difference between the target time scale and TAI. For example, if the target time scale is always 10 seconds ahead of TAI, then the offset should be +10 seconds.
Attributes
- Supertypes
- Known subtypes
GLONASS scale implementation GLONASS is a fixed offset from UTC + 3 hours
GLONASS scale implementation GLONASS is a fixed offset from UTC + 3 hours
Value parameters
- utc
-
UTC scale
Attributes
- Supertypes
GPS scale implementation
GPS scale implementation
Attributes
- See also
- Supertypes
NavIC timescale (also called IRNWT for IRNSS NetWork Time).
NavIC timescale (also called IRNWT for IRNSS NetWork Time).
Attributes
- See also
- Supertypes
TAI scale implementation
TAI scale implementation
Attributes
- See also
- Supertypes
Value parameters
- j2000Epoch
-
The j2000 standard epoch
- tt
-
The Terrestrial Time Scale
Attributes
- See also
- Note
-
Do not instantiate this class for most cases. See TimeScaleFactory
- Supertypes
TDT is the same as TTScale
TDT is the same as TTScale
Attributes
- Supertypes
-
class TTScaleclass FixedTimeOffsetScaletrait TimeScaleclass Objecttrait Matchableclass AnyShow all
TT scale implementation
A robust time implementation with Hour, Minutes, Seconds of a day. Seconds are in precision up to attoseconds.
A robust time implementation with Hour, Minutes, Seconds of a day. Seconds are in precision up to attoseconds.
Attributes
- See also
-
TimeFormat
Date
- Note
-
This class is immutable and thread-safe
- Companion
- object
- Supertypes
Represents a time format with second and attosecond precision.
Represents a time format with second and attosecond precision.
This class allows representing time values with a high degree of precision, using seconds and attoseconds (10^-18 seconds) as the units. It provides functionalities for basic arithmetic operations, comparisons, and conversions to and from other time units.
Value parameters
- attoseconds
-
The number of attoseconds. Can be positive, negative, or zero. Must be in the range (-10^18, 10^18).
- seconds
-
The number of seconds. Can be positive, negative, or zero.
Attributes
- Throws
-
IllegalArgumentException
if attoseconds is outside the allowed range. Example usage:
val time1 = new TimeFormat(1, 500000000000000000L) // 1.5 seconds val time2 = new TimeFormat(0, 750000000000000000L) // 0.75 seconds val sum = time1 + time2 // 2.25 seconds val difference = time1 - time2 // 0.75 seconds println(s"Sum: $sum") println(s"Difference: $difference")
- Companion
- object
- Supertypes
- Known subtypes
-
class AbsoluteTime
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TimeFormat.type
A trait representing a time scale system for astronomical time calculations.
A trait representing a time scale system for astronomical time calculations.
TimeScale provides mechanisms to convert between different time standards, with TAI (International Atomic Time) serving as a reference scale. Time scales may handle leap seconds and other time adjustments differently.
Common implementations include UTC, TAI, TT, etc.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class FixedTimeOffsetScaleclass GPSScaleclass IRNSSScaleclass TAIScaleclass TTScaleclass TDTScaleclass GLONASSScaleclass TDBScaleclass UTCScaleShow all
A factory for obtaining singleton instances of various time scales.
A factory for obtaining singleton instances of various time scales.
This object uses a thread-safe approach with AtomicReference
to ensure that only a single instance of each time scale is created and returned. This is a form of the Singleton design pattern.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TimeScaleFactory.type
Represents different units of time measurement in descending order of magnitude.
Represents different units of time measurement in descending order of magnitude.
This enum provides various time units from days down to attoseconds, allowing for precise time measurements and conversions across different scales.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Implements the UTC (Coordinated Universal Time) time scale, including leap second handling.
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
- Supertypes