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
- Graph
-
- Supertypes
-
class TimeFormattrait Serializabletrait Comparable[TimeFormat]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Constructors
Default constructor. Creates an AbsoluteTime
instance using the J2000 epoch (January 1, 2000, 12:00 TT).
Default constructor. Creates an AbsoluteTime
instance using the J2000 epoch (January 1, 2000, 12:00 TT).
==Math Note==
- J2000 epoch corresponds to JD 2451545.0 TT.
- This is exactly 12:00 Terrestrial Time on Jan 1, 2000.
Attributes
Constructor to create an AbsoluteTime
instance using a Date
, Time
, and TimeScale
.
Constructor to create an AbsoluteTime
instance using a Date
, Time
, and TimeScale
.
==Math Note==
- Days since J2000 are converted to seconds:
total_seconds = (days_since_J2000 * 86400)
+ (hours * 3600)
+ (minutes * 60)
+ seconds
- UTC offset and leap seconds are applied via TimeScale.timeToTAI.
Value parameters
- date
-
the date component
- scale
-
the time scale used to convert the time to TAI
- time
-
the time component
Attributes
Constructor to create an AbsoluteTime
instance using year, month, day, hour, minute, seconds (as TimeFormat
), and a TimeScale
.
Constructor to create an AbsoluteTime
instance using year, month, day, hour, minute, seconds (as TimeFormat
), and a TimeScale
.
==Math Note==
- Calendar date → Julian Day Number (JDN) → J2000 offset.
- J2000 offset = (JDN - 2451545.0) * 86400.
Attributes
- Throws
-
IllegalArgumentException
if the input values are invalid
Constructor to create an AbsoluteTime
instance using year, month, day, hour, minute, seconds (as Double
), and a TimeScale
.
Constructor to create an AbsoluteTime
instance using year, month, day, hour, minute, seconds (as Double
), and a TimeScale
.
==Math Note==
- Seconds are converted to TimeFormat with attosecond precision.
Attributes
- Throws
-
IllegalArgumentException
if the input values are invalid
Constructor to create an AbsoluteTime
instance using year, month (as Month
enum), day, hour, minute, seconds (as TimeFormat
), and a TimeScale
.
Constructor to create an AbsoluteTime
instance using year, month (as Month
enum), day, hour, minute, seconds (as TimeFormat
), and a TimeScale
.
==Math Note==
- Uses Month.getIntegerValue to map enum → integer month.
Attributes
Constructor to create an AbsoluteTime
instance using year, month (as Month
enum), day, hour, minute, seconds (as Double
), and a TimeScale
.
Constructor to create an AbsoluteTime
instance using year, month (as Month
enum), day, hour, minute, seconds (as Double
), and a TimeScale
.
Attributes
Constructor to create an AbsoluteTime
instance using a Date
and a TimeScale
. The time component is set to 00:00:00 by default.
Constructor to create an AbsoluteTime
instance using a Date
and a TimeScale
. The time component is set to 00:00:00 by default.
Attributes
Constructor to create an AbsoluteTime
instance using year, month, day, and a TimeScale
. The time component is set to 00:00:00 by default.
Constructor to create an AbsoluteTime
instance using year, month, day, and a TimeScale
. The time component is set to 00:00:00 by default.
Attributes
Constructor to create an AbsoluteTime
instance from a Java Instant and a given timescale.
Constructor to create an AbsoluteTime
instance from a Java Instant and a given timescale.
==Math Note==
- Java Instant is always UTC-based.
- Conversion:
epoch_seconds + nanos → TimeFormat
.
Attributes
Constructor to create an AbsoluteTime
instance from a Java Instant. Uses UTC as the default timescale.
Constructor to create an AbsoluteTime
instance from a Java Instant. Uses UTC as the default timescale.
Attributes
Concrete methods
Shift by a TimeFormat duration.
Shift by a number of seconds (Long).
Shift by a number of seconds (Long).
Attributes
Shift by a number of seconds (Double).
Shift by a number of seconds (Double).
Attributes
Computes the duration between this time and another AbsoluteTime
.
Computes the duration between this time and another AbsoluteTime
.
==Math Note==
- Duration = Δt = (this.seconds - other.seconds).
Attributes
Converts this absolute time into a (Date, Time)
pair in the given timescale.
Converts this absolute time into a (Date, Time)
pair in the given timescale.
==Math Note==
- Shift by 43200 seconds (12h) because J2000 epoch is defined at 12:00 TT, not midnight.
- Day calculation:
j2000_shifted = seconds_since_J2000 + 43200
day_index = floor(j2000_shifted / 86400)
time_of_day = j2000_shifted mod 86400
- Leap seconds are applied if the instant falls inside a leap second.
Value parameters
- scale
-
the timescale to use
Attributes
- Returns
-
a tuple of (Date, Time)
Computes the offset between two time scales at this absolute time.
Computes the offset between two time scales at this absolute time.
==Math Note==
- Offset = Δ = (scale1 - TAI) - (scale2 - TAI).
- Example: UTC vs TAI → difference = leap seconds.
Value parameters
- scale1
-
the first timescale
- scale2
-
the second timescale
Attributes
- Returns
-
the offset between the two timescales as a TimeFormat
Returns the ISO-8601 string representation of this time in UTC. Appends "Z" to indicate UTC.
Returns the ISO-8601 string representation of this time in UTC. Appends "Z" to indicate UTC.
Attributes
- Definition Classes
-
TimeFormat -> Any
Inherited methods
Compares this TimeFormat instance with another TimeFormat instance.
Compares this TimeFormat instance with another TimeFormat instance.
Value parameters
- o
-
The TimeFormat instance to compare with
Attributes
- Returns
-
An integer value: - Negative if this instance is less than the other - Zero if they are equal - Positive if this instance is greater than the other
- Definition Classes
-
TimeFormat -> Comparable
- Inherited from:
- TimeFormat
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)
).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
true
if the receiver object is equivalent to the argument;false
otherwise. - Definition Classes
-
TimeFormat -> Any
- Inherited from:
- TimeFormat
Gets the attoseconds component of the time value.
Gets the attoseconds component of the time value.
Attributes
- Returns
-
The number of attoseconds
- Inherited from:
- TimeFormat
Attributes
- Inherited from:
- TimeFormat
Gets the seconds component of the time value.
Gets the seconds component of the time value.
Attributes
- Returns
-
The number of seconds
- Inherited from:
- TimeFormat
Calculates a hash code value for the object.
Calculates a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
. However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals
method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
TimeFormat -> Any
- Inherited from:
- TimeFormat
Checks if this TimeFormat represents zero time (both seconds and attoseconds are 0).
Checks if this TimeFormat represents zero time (both seconds and attoseconds are 0).
Attributes
- Returns
-
true if the time value is zero, false otherwise
- Inherited from:
- TimeFormat
Creates a new TimeFormat instance with the negated values of seconds and attoseconds.
Creates a new TimeFormat instance with the negated values of seconds and attoseconds.
Attributes
- Returns
-
A new TimeFormat instance with negated values
- Inherited from:
- TimeFormat
Converts current time format to double, "seconds[.]attoseconds"
Converts current time format to double, "seconds[.]attoseconds"
Attributes
- Returns
-
a double value
- Inherited from:
- TimeFormat