org.orekit.time

## Class AbsoluteDate

• ### Field Summary

Fields
Modifier and Type Field and Description
static AbsoluteDate ARBITRARY_EPOCH
An arbitrary finite date.
static AbsoluteDate BEIDOU_EPOCH
Reference epoch for BeiDou weeks: 2006-01-01T00:00:00 UTC.
static AbsoluteDate CCSDS_EPOCH
Reference epoch for CCSDS Time Code Format (CCSDS 301.0-B-4): 1958-01-01T00:00:00 International Atomic Time (not UTC).
static AbsoluteDate FIFTIES_EPOCH
Reference epoch for 1950 dates: 1950-01-01T00:00:00 Terrestrial Time.
static AbsoluteDate FUTURE_INFINITY
Dummy date at infinity in the future direction.
static AbsoluteDate GALILEO_EPOCH
Reference epoch for Galileo System Time: 1999-08-22T00:00:00 GST.
static AbsoluteDate GLONASS_EPOCH
Reference epoch for GLONASS four-year interval number: 1996-01-01T00:00:00 GLONASS time.
static AbsoluteDate GPS_EPOCH
Reference epoch for GPS weeks: 1980-01-06T00:00:00 GPS time.
static AbsoluteDate IRNSS_EPOCH
Reference epoch for IRNSS weeks: 1999-08-22T00:00:00 IRNSS time.
static AbsoluteDate J2000_EPOCH
J2000.0 Reference epoch: 2000-01-01T12:00:00 Terrestrial Time (not UTC).
static AbsoluteDate JAVA_EPOCH
Java Reference epoch: 1970-01-01T00:00:00 Universal Time Coordinate.
static AbsoluteDate JULIAN_EPOCH
Reference epoch for julian dates: -4712-01-01T12:00:00 Terrestrial Time.
static AbsoluteDate MODIFIED_JULIAN_EPOCH
Reference epoch for modified julian dates: 1858-11-17T00:00:00 Terrestrial Time.
static AbsoluteDate PAST_INFINITY
Dummy date at infinity in the past direction.
static AbsoluteDate QZSS_EPOCH
Reference epoch for QZSS weeks: 1980-01-06T00:00:00 QZSS time.
• ### Constructor Summary

Constructors
Constructor and Description
AbsoluteDate()
Create an instance with a default value (J2000_EPOCH).
AbsoluteDate(AbsoluteDate since, double elapsedDuration)
Build an instance from an elapsed duration since to another instant.
AbsoluteDate(AbsoluteDate reference, double apparentOffset, TimeScale timeScale)
Build an instance from an apparent clock offset with respect to another instant in the perspective of a specific time scale.
AbsoluteDate(DateComponents date, TimeComponents time, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(DateComponents date, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(DateTimeComponents location, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(Date location, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(int year, int month, int day, int hour, int minute, double second, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(int year, int month, int day, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(int year, Month month, int day, int hour, int minute, double second, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(int year, Month month, int day, TimeScale timeScale)
Build an instance from a location in a time scale.
AbsoluteDate(String location, TimeScale timeScale)
Build an instance from a location (parsed from a string) in a time scale.
• ### Method Summary

All Methods
Modifier and Type Method and Description
int compareTo(AbsoluteDate date)
Compare the instance with another date.
static AbsoluteDate createBesselianEpoch(double besselianEpoch)
Build an instance corresponding to a Besselian Epoch (BE).
static AbsoluteDate createJDDate(int jd, double secondsSinceNoon, TimeScale timeScale)
Build an instance corresponding to a Julian Day date.
static AbsoluteDate createJulianEpoch(double julianEpoch)
Build an instance corresponding to a Julian Epoch (JE).
static AbsoluteDate createMJDDate(int mjd, double secondsInDay, TimeScale timeScale)
Build an instance corresponding to a Modified Julian Day date.
double durationFrom(AbsoluteDate instant)
Compute the physically elapsed duration between two instants.
boolean equals(Object date)
Check if the instance represents the same time as another instance.
DateTimeComponents getComponents(int minutesFromUTC)
Split the instance into date/time components for a local time.
DateTimeComponents getComponents(int minutesFromUTC, TimeScale utc)
Split the instance into date/time components for a local time.
DateTimeComponents getComponents(TimeScale timeScale)
Split the instance into date/time components.
DateTimeComponents getComponents(TimeZone timeZone)
Split the instance into date/time components for a time zone.
DateTimeComponents getComponents(TimeZone timeZone, TimeScale utc)
Split the instance into date/time components for a time zone.
AbsoluteDate getDate()
Get the date.
int hashCode()
Get a hashcode for this date.
boolean isAfter(TimeStamped other)
Check if the instance represents a time that is strictly after another.
boolean isAfterOrEqualTo(TimeStamped other)
Check if the instance represents a time that is after or equal to another.
boolean isBefore(TimeStamped other)
Check if the instance represents a time that is strictly before another.
boolean isBeforeOrEqualTo(TimeStamped other)
Check if the instance represents a time that is before or equal to another.
boolean isBetween(TimeStamped boundary, TimeStamped otherBoundary)
Check if the instance represents a time that is strictly between two others representing the boundaries of a time span.
boolean isBetweenOrEqualTo(TimeStamped boundary, TimeStamped otherBoundary)
Check if the instance represents a time that is between two others representing the boundaries of a time span, or equal to one of them.
boolean isCloseTo(TimeStamped other, double tolerance)
Check if the instance time is close to another.
boolean isEqualTo(TimeStamped other)
Check if the instance represents the same time as another.
double offsetFrom(AbsoluteDate instant, TimeScale timeScale)
Compute the apparent clock offset between two instant in the perspective of a specific time scale.
static AbsoluteDate parseCCSDSCalendarSegmentedTimeCode(byte preambleField, byte[] timeField)
Build an instance from a CCSDS Calendar Segmented Time Code (CCS).
static AbsoluteDate parseCCSDSCalendarSegmentedTimeCode(byte preambleField, byte[] timeField, TimeScale utc)
Build an instance from a CCSDS Calendar Segmented Time Code (CCS).
static AbsoluteDate parseCCSDSDaySegmentedTimeCode(byte preambleField, byte[] timeField, DateComponents agencyDefinedEpoch)
Build an instance from a CCSDS Day Segmented Time Code (CDS).
static AbsoluteDate parseCCSDSDaySegmentedTimeCode(byte preambleField, byte[] timeField, DateComponents agencyDefinedEpoch, TimeScale utc)
Build an instance from a CCSDS Day Segmented Time Code (CDS).
static AbsoluteDate parseCCSDSUnsegmentedTimeCode(byte preambleField1, byte preambleField2, byte[] timeField, AbsoluteDate agencyDefinedEpoch)
Build an instance from a CCSDS Unsegmented Time Code (CUC).
static AbsoluteDate parseCCSDSUnsegmentedTimeCode(byte preambleField1, byte preambleField2, byte[] timeField, AbsoluteDate agencyDefinedEpoch, AbsoluteDate ccsdsEpoch)
Build an instance from a CCSDS Unsegmented Time Code (CUC).
AbsoluteDate shiftedBy(double dt)
Get a time-shifted date.
double timeScalesOffset(TimeScale scale1, TimeScale scale2)
Compute the offset between two time scales at the current instant.
Date toDate(TimeScale timeScale)
Convert the instance to a Java Date.
String toString()
Get a String representation of the instant location with up to 16 digits of precision for the seconds value.
String toString(int minutesFromUTC)
Get a String representation of the instant location for a local time.
String toString(int minutesFromUTC, TimeScale utc)
Get a String representation of the instant location for a local time.
String toString(TimeScale timeScale)
Get a String representation of the instant location in ISO-8601 format without the UTC offset and with up to 16 digits of precision for the seconds value.
String toString(TimeZone timeZone)
Get a String representation of the instant location for a time zone.
String toString(TimeZone timeZone, TimeScale utc)
Get a String representation of the instant location for a time zone.
String toStringRfc3339(TimeScale utc)
Represent the given date as a string according to the format in RFC 3339.
String toStringWithoutUtcOffset(TimeScale timeScale, int fractionDigits)
Return a string representation of this date-time, rounded to the given precision.
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### AbsoluteDate

public AbsoluteDate(DateTimeComponents location,
TimeScale timeScale)
Build an instance from a location in a time scale.
Parameters:
location - location in the time scale
timeScale - time scale
• #### AbsoluteDate

public AbsoluteDate(DateComponents date,
TimeComponents time,
TimeScale timeScale)
Build an instance from a location in a time scale.
Parameters:
date - date location in the time scale
time - time location in the time scale
timeScale - time scale
• #### AbsoluteDate

public AbsoluteDate(int year,
int month,
int day,
int hour,
int minute,
double second,
TimeScale timeScale)
throws IllegalArgumentException
Build an instance from a location in a time scale.
Parameters:
year - year number (may be 0 or negative for BC years)
month - month number from 1 to 12
day - day number from 1 to 31
hour - hour number from 0 to 23
minute - minute number from 0 to 59
second - second number from 0.0 to 60.0 (excluded)
timeScale - time scale
Throws:
IllegalArgumentException - if inconsistent arguments are given (parameters out of range)
• #### AbsoluteDate

public AbsoluteDate(int year,
Month month,
int day,
int hour,
int minute,
double second,
TimeScale timeScale)
throws IllegalArgumentException
Build an instance from a location in a time scale.
Parameters:
year - year number (may be 0 or negative for BC years)
month - month enumerate
day - day number from 1 to 31
hour - hour number from 0 to 23
minute - minute number from 0 to 59
second - second number from 0.0 to 60.0 (excluded)
timeScale - time scale
Throws:
IllegalArgumentException - if inconsistent arguments are given (parameters out of range)
• #### AbsoluteDate

public AbsoluteDate(DateComponents date,
TimeScale timeScale)
throws IllegalArgumentException
Build an instance from a location in a time scale.

The hour is set to 00:00:00.000.

Parameters:
date - date location in the time scale
timeScale - time scale
Throws:
IllegalArgumentException - if inconsistent arguments are given (parameters out of range)
• #### AbsoluteDate

public AbsoluteDate(int year,
int month,
int day,
TimeScale timeScale)
throws IllegalArgumentException
Build an instance from a location in a time scale.

The hour is set to 00:00:00.000.

Parameters:
year - year number (may be 0 or negative for BC years)
month - month number from 1 to 12
day - day number from 1 to 31
timeScale - time scale
Throws:
IllegalArgumentException - if inconsistent arguments are given (parameters out of range)
• #### AbsoluteDate

public AbsoluteDate(int year,
Month month,
int day,
TimeScale timeScale)
throws IllegalArgumentException
Build an instance from a location in a time scale.

The hour is set to 00:00:00.000.

Parameters:
year - year number (may be 0 or negative for BC years)
month - month enumerate
day - day number from 1 to 31
timeScale - time scale
Throws:
IllegalArgumentException - if inconsistent arguments are given (parameters out of range)
• #### AbsoluteDate

public AbsoluteDate(Date location,
TimeScale timeScale)
Build an instance from a location in a time scale.
Parameters:
location - location in the time scale
timeScale - time scale
• #### AbsoluteDate

public AbsoluteDate(AbsoluteDate since,
double elapsedDuration)
Build an instance from an elapsed duration since to another instant.

It is important to note that the elapsed duration is not the difference between two readings on a time scale. As an example, the duration between the two instants leading to the readings 2005-12-31T23:59:59 and 2006-01-01T00:00:00 in the UTC time scale is not 1 second, but a stop watch would have measured an elapsed duration of 2 seconds between these two instances because a leap second was introduced at the end of 2005 in this time scale.

This constructor is the reverse of the durationFrom(AbsoluteDate) method.

Parameters:
since - start instant of the measured duration
elapsedDuration - physically elapsed duration from the since instant, as measured in a regular time scale
durationFrom(AbsoluteDate)
• #### AbsoluteDate

public AbsoluteDate(AbsoluteDate reference,
double apparentOffset,
TimeScale timeScale)
Build an instance from an apparent clock offset with respect to another instant in the perspective of a specific time scale.

It is important to note that the apparent clock offset is the difference between two readings on a time scale and not an elapsed duration. As an example, the apparent clock offset between the two instants leading to the readings 2005-12-31T23:59:59 and 2006-01-01T00:00:00 in the UTC time scale is 1 second, but the elapsed duration is 2 seconds because a leap second has been introduced at the end of 2005 in this time scale.

This constructor is the reverse of the offsetFrom(AbsoluteDate, TimeScale) method.

Parameters:
reference - reference instant
apparentOffset - apparent clock offset from the reference instant (difference between two readings in the specified time scale)
timeScale - time scale with respect to which the offset is defined
offsetFrom(AbsoluteDate, TimeScale)
• ### Method Detail

• #### parseCCSDSUnsegmentedTimeCode

@DefaultDataContext
public static AbsoluteDate parseCCSDSUnsegmentedTimeCode(byte preambleField1,
byte preambleField2,
byte[] timeField,
AbsoluteDate agencyDefinedEpoch)
Build an instance from a CCSDS Unsegmented Time Code (CUC).

CCSDS Unsegmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

If the date to be parsed is formatted using version 3 of the standard (CCSDS 301.0-B-3 published in 2002) or if the extension of the preamble field introduced in version 4 of the standard is not used, then the preambleField2 parameter can be set to 0.

This method uses the default data context if the CCSDS epoch is used.

Parameters:
preambleField1 - first byte of the field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
preambleField2 - second byte of the field specifying the format (added in revision 4 of the CCSDS standard in 2010), often not transmitted in data interfaces, as it is constant for a given data interface (value ignored if presence not signaled in preambleField1)
timeField - byte array containing the time code
agencyDefinedEpoch - reference epoch, ignored if the preamble field specifies the CCSDS reference epoch is used (and hence may be null in this case)
Returns:
an instance corresponding to the specified date
parseCCSDSUnsegmentedTimeCode(byte, byte, byte[], AbsoluteDate, AbsoluteDate)
• #### parseCCSDSUnsegmentedTimeCode

public static AbsoluteDate parseCCSDSUnsegmentedTimeCode(byte preambleField1,
byte preambleField2,
byte[] timeField,
AbsoluteDate agencyDefinedEpoch,
AbsoluteDate ccsdsEpoch)
Build an instance from a CCSDS Unsegmented Time Code (CUC).

CCSDS Unsegmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

If the date to be parsed is formatted using version 3 of the standard (CCSDS 301.0-B-3 published in 2002) or if the extension of the preamble field introduced in version 4 of the standard is not used, then the preambleField2 parameter can be set to 0.

Parameters:
preambleField1 - first byte of the field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
preambleField2 - second byte of the field specifying the format (added in revision 4 of the CCSDS standard in 2010), often not transmitted in data interfaces, as it is constant for a given data interface (value ignored if presence not signaled in preambleField1)
timeField - byte array containing the time code
agencyDefinedEpoch - reference epoch, ignored if the preamble field specifies the CCSDS reference epoch is used (and hence may be null in this case)
ccsdsEpoch - reference epoch, ignored if the preamble field specifies the agency epoch is used.
Returns:
an instance corresponding to the specified date
Since:
10.1
• #### parseCCSDSDaySegmentedTimeCode

@DefaultDataContext
public static AbsoluteDate parseCCSDSDaySegmentedTimeCode(byte preambleField,
byte[] timeField,
DateComponents agencyDefinedEpoch)
Build an instance from a CCSDS Day Segmented Time Code (CDS).

CCSDS Day Segmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

This method uses the default data context.

Parameters:
preambleField - field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
timeField - byte array containing the time code
agencyDefinedEpoch - reference epoch, ignored if the preamble field specifies the CCSDS reference epoch is used (and hence may be null in this case)
Returns:
an instance corresponding to the specified date
parseCCSDSDaySegmentedTimeCode(byte, byte[], DateComponents, TimeScale)
• #### parseCCSDSDaySegmentedTimeCode

public static AbsoluteDate parseCCSDSDaySegmentedTimeCode(byte preambleField,
byte[] timeField,
DateComponents agencyDefinedEpoch,
TimeScale utc)
Build an instance from a CCSDS Day Segmented Time Code (CDS).

CCSDS Day Segmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

Parameters:
preambleField - field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
timeField - byte array containing the time code
agencyDefinedEpoch - reference epoch, ignored if the preamble field specifies the CCSDS reference epoch is used (and hence may be null in this case)
utc - time scale used to compute date and time components.
Returns:
an instance corresponding to the specified date
Since:
10.1
• #### parseCCSDSCalendarSegmentedTimeCode

@DefaultDataContext
public static AbsoluteDate parseCCSDSCalendarSegmentedTimeCode(byte preambleField,
byte[] timeField)
Build an instance from a CCSDS Calendar Segmented Time Code (CCS).

CCSDS Calendar Segmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

This method uses the default data context.

Parameters:
preambleField - field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
timeField - byte array containing the time code
Returns:
an instance corresponding to the specified date
parseCCSDSCalendarSegmentedTimeCode(byte, byte[], TimeScale)
• #### parseCCSDSCalendarSegmentedTimeCode

public static AbsoluteDate parseCCSDSCalendarSegmentedTimeCode(byte preambleField,
byte[] timeField,
TimeScale utc)
Build an instance from a CCSDS Calendar Segmented Time Code (CCS).

CCSDS Calendar Segmented Time Code is defined in the blue book: CCSDS Time Code Format (CCSDS 301.0-B-4) published in November 2010

Parameters:
preambleField - field specifying the format, often not transmitted in data interfaces, as it is constant for a given data interface
timeField - byte array containing the time code
utc - time scale used to compute date and time components.
Returns:
an instance corresponding to the specified date
Since:
10.1
• #### createJDDate

public static AbsoluteDate createJDDate(int jd,
double secondsSinceNoon,
TimeScale timeScale)
Build an instance corresponding to a Julian Day date.
Parameters:
jd - Julian day
secondsSinceNoon - seconds in the Julian day (BEWARE, Julian days start at noon, so 0.0 is noon)
timeScale - time scale in which the seconds in day are defined
Returns:
a new instant
• #### createMJDDate

public static AbsoluteDate createMJDDate(int mjd,
double secondsInDay,
TimeScale timeScale)
throws OrekitIllegalArgumentException
Build an instance corresponding to a Modified Julian Day date.
Parameters:
mjd - modified Julian day
secondsInDay - seconds in the day
timeScale - time scale in which the seconds in day are defined
Returns:
a new instant
Throws:
OrekitIllegalArgumentException - if seconds number is out of range
• #### offsetFrom

public double offsetFrom(AbsoluteDate instant,
TimeScale timeScale)
Compute the apparent clock offset between two instant in the perspective of a specific time scale.

The offset is the number of seconds counted in the given time scale between the locations of the two instants, with all time scale irregularities removed (i.e. considering all days are exactly 86400 seconds long). This method will give a result that may not have a physical meaning if the time scale is irregular. For example since a leap second was introduced at the end of 2005, the apparent offset between 2005-12-31T23:59:59 and 2006-01-01T00:00:00 is 1 second, but the physical duration of the corresponding time interval as returned by the durationFrom(AbsoluteDate) method is 2 seconds.

This method is the reverse of the AbsoluteDate(AbsoluteDate, double, TimeScale) constructor.

Parameters:
instant - instant to subtract from the instance
timeScale - time scale with respect to which the offset should be computed
Returns:
apparent clock offset in seconds between the two instants (positive if the instance is posterior to the argument)
durationFrom(AbsoluteDate), AbsoluteDate(AbsoluteDate, double, TimeScale)
• #### timeScalesOffset

public double timeScalesOffset(TimeScale scale1,
TimeScale scale2)
Compute the offset between two time scales at the current instant.

The offset is defined as l₁-l₂ where l₁ is the location of the instant in the scale1 time scale and l₂ is the location of the instant in the scale2 time scale.

Parameters:
scale1 - first time scale
scale2 - second time scale
Returns:
offset in seconds between the two time scales at the current instant
• #### toDate

public Date toDate(TimeScale timeScale)
Convert the instance to a Java Date.

Conversion to the Date class induces a loss of precision because the Date class does not provide sub-millisecond information. Java Dates are considered to be locations in some times scales.

Parameters:
timeScale - time scale to use
Returns:
a Date instance representing the location of the instant in the time scale
• #### getComponents

public DateTimeComponents getComponents(TimeScale timeScale)
Split the instance into date/time components.
Parameters:
timeScale - time scale to use
Returns:
date/time components
• #### getComponents

@DefaultDataContext
public DateTimeComponents getComponents(int minutesFromUTC)
Split the instance into date/time components for a local time.

This method uses the default data context.

Parameters:
minutesFromUTC - offset in minutes from UTC (positive Eastwards UTC, negative Westward UTC)
Returns:
date/time components
Since:
7.2
getComponents(int, TimeScale)
• #### getComponents

public DateTimeComponents getComponents(int minutesFromUTC,
TimeScale utc)
Split the instance into date/time components for a local time.
Parameters:
minutesFromUTC - offset in minutes from UTC (positive Eastwards UTC, negative Westward UTC)
utc - time scale used to compute date and time components.
Returns:
date/time components
Since:
10.1
• #### getComponents

public DateTimeComponents getComponents(TimeZone timeZone,
TimeScale utc)
Split the instance into date/time components for a time zone.
Parameters:
timeZone - time zone
utc - time scale used to computed date and time components.
Returns:
date/time components
Since:
10.1
• #### compareTo

public int compareTo(AbsoluteDate date)
Compare the instance with another date.
Specified by:
compareTo in interface Comparable<AbsoluteDate>
Parameters:
date - other date to compare the instance to
Returns:
a negative integer, zero, or a positive integer as this date is before, simultaneous, or after the specified date.
• #### getDate

public AbsoluteDate getDate()
Get the date.
Specified by:
getDate in interface TimeStamped
Returns:
date attached to the object
• #### equals

public boolean equals(Object date)
Check if the instance represents the same time as another instance.
Overrides:
equals in class Object
Parameters:
date - other date
Returns:
true if the instance and the other date refer to the same instant
• #### isEqualTo

public boolean isEqualTo(TimeStamped other)
Check if the instance represents the same time as another.
Parameters:
other - the instant to compare this date to
Returns:
true if the instance and the argument refer to the same instant
Since:
10.1
isCloseTo(TimeStamped, double)
• #### isCloseTo

public boolean isCloseTo(TimeStamped other,
double tolerance)
Check if the instance time is close to another.
Parameters:
other - the instant to compare this date to
tolerance - the separation, in seconds, under which the two instants will be considered close to each other
Returns:
true if the duration between the instance and the argument is strictly below the tolerance
Since:
10.1
isEqualTo(TimeStamped)
• #### isBefore

public boolean isBefore(TimeStamped other)
Check if the instance represents a time that is strictly before another.
Parameters:
other - the instant to compare this date to
Returns:
true if the instance is strictly before the argument when ordering chronologically
Since:
10.1
isBeforeOrEqualTo(TimeStamped)
• #### isAfter

public boolean isAfter(TimeStamped other)
Check if the instance represents a time that is strictly after another.
Parameters:
other - the instant to compare this date to
Returns:
true if the instance is strictly after the argument when ordering chronologically
Since:
10.1
isAfterOrEqualTo(TimeStamped)
• #### isBeforeOrEqualTo

public boolean isBeforeOrEqualTo(TimeStamped other)
Check if the instance represents a time that is before or equal to another.
Parameters:
other - the instant to compare this date to
Returns:
true if the instance is before (or equal to) the argument when ordering chronologically
Since:
10.1
isBefore(TimeStamped)
• #### isAfterOrEqualTo

public boolean isAfterOrEqualTo(TimeStamped other)
Check if the instance represents a time that is after or equal to another.
Parameters:
other - the instant to compare this date to
Returns:
true if the instance is after (or equal to) the argument when ordering chronologically
Since:
10.1
isAfterOrEqualTo(TimeStamped)
• #### isBetween

public boolean isBetween(TimeStamped boundary,
TimeStamped otherBoundary)
Check if the instance represents a time that is strictly between two others representing the boundaries of a time span. The two boundaries can be provided in any order: in other words, whether boundary represents a time that is before or after otherBoundary will not change the result of this method.
Parameters:
boundary - one end of the time span
otherBoundary - the other end of the time span
Returns:
true if the instance is strictly between the two arguments when ordering chronologically
Since:
10.1
isBetweenOrEqualTo(TimeStamped, TimeStamped)
• #### isBetweenOrEqualTo

public boolean isBetweenOrEqualTo(TimeStamped boundary,
TimeStamped otherBoundary)
Check if the instance represents a time that is between two others representing the boundaries of a time span, or equal to one of them. The two boundaries can be provided in any order: in other words, whether boundary represents a time that is before or after otherBoundary will not change the result of this method.
Parameters:
boundary - one end of the time span
otherBoundary - the other end of the time span
Returns:
true if the instance is between the two arguments (or equal to at least one of them) when ordering chronologically
Since:
10.1
isBetween(TimeStamped, TimeStamped)
• #### hashCode

public int hashCode()
Get a hashcode for this date.
Overrides:
hashCode in class Object
Returns:
hashcode
• #### toString

@DefaultDataContext
public String toString()
Get a String representation of the instant location with up to 16 digits of precision for the seconds value.

Since this method is used in exception messages and error handling every effort is made to return some representation of the instant. If UTC is available from the default data context then it is used to format the string in UTC. If not then TAI is used. Finally if the prior attempts fail this method falls back to converting this class's internal representation to a string.

This method uses the default data context.

Overrides:
toString in class Object
Returns:
a string representation of the instance, in ISO-8601 format if UTC is available from the default data context.
toString(TimeScale), toStringRfc3339(TimeScale), DateTimeComponents.toString(int, int)
• #### toString

public String toString(TimeScale timeScale)
Get a String representation of the instant location in ISO-8601 format without the UTC offset and with up to 16 digits of precision for the seconds value.
Parameters:
timeScale - time scale to use
Returns:
a string representation of the instance.
toStringRfc3339(TimeScale), DateTimeComponents.toString(int, int)
• #### toString

@DefaultDataContext
public String toString(int minutesFromUTC)
Get a String representation of the instant location for a local time.

This method uses the default data context.

Parameters:
minutesFromUTC - offset in minutes from UTC (positive Eastwards UTC, negative Westward UTC).
Returns:
string representation of the instance, in ISO-8601 format with milliseconds accuracy
Since:
7.2
toString(int, TimeScale)
• #### toString

public String toString(int minutesFromUTC,
TimeScale utc)
Get a String representation of the instant location for a local time.
Parameters:
minutesFromUTC - offset in minutes from UTC (positive Eastwards UTC, negative Westward UTC).
utc - time scale used to compute date and time components.
Returns:
string representation of the instance, in ISO-8601 format with milliseconds accuracy
Since:
10.1
getComponents(int, TimeScale), DateTimeComponents.toString(int, int)
• #### toString

@DefaultDataContext
public String toString(TimeZone timeZone)
Get a String representation of the instant location for a time zone.

This method uses the default data context.

Parameters:
timeZone - time zone
Returns:
string representation of the instance, in ISO-8601 format with milliseconds accuracy
Since:
7.2
toString(TimeZone, TimeScale)
• #### toString

public String toString(TimeZone timeZone,
TimeScale utc)
Get a String representation of the instant location for a time zone.
Parameters:
timeZone - time zone
utc - time scale used to compute date and time components.
Returns:
string representation of the instance, in ISO-8601 format with milliseconds accuracy
Since:
10.1
getComponents(TimeZone, TimeScale), DateTimeComponents.toString(int, int)
• #### toStringRfc3339

public String toStringRfc3339(TimeScale utc)
Represent the given date as a string according to the format in RFC 3339. RFC3339 is a restricted subset of ISO 8601 with a well defined grammar. Enough digits are included in the seconds value to avoid rounding up to the next minute.

This method is different than toString(TimeScale) in that it includes a "Z" at the end to indicate the time zone and enough precision to represent the point in time without rounding up to the next minute.

RFC3339 is unable to represent BC years, years of 10000 or more, time zone offsets of 100 hours or more, or NaN. In these cases the value returned from this method will not be valid RFC3339 format.

Parameters:
utc - time scale.
Returns:
RFC 3339 format string.
RFC 3339, DateTimeComponents.toStringRfc3339(), toString(TimeScale), getComponents(TimeScale)
• #### toStringWithoutUtcOffset

public String toStringWithoutUtcOffset(TimeScale timeScale,
int fractionDigits)
Return a string representation of this date-time, rounded to the given precision.

The format used is ISO8601 without the UTC offset.

Calling toStringWithoutUtcOffset(DataContext.getDefault().getTimeScales().getUTC(), 3) will emulate the behavior of toString() in Orekit 10 and earlier. Note this method is more accurate as it correctly handles rounding during leap seconds.

Parameters:
timeScale - to use to compute components.
fractionDigits - the number of digits to include after the decimal point in the string representation of the seconds. The date and time is first rounded as necessary. fractionDigits must be greater than or equal to 0.
Returns:
string representation of this date, time, and UTC offset
Since:
11.1
toString(TimeScale), toStringRfc3339(TimeScale), DateTimeComponents.toString(int, int), DateTimeComponents.toStringWithoutUtcOffset(int, int)