Class JulianDay
- All Implemented Interfaces:
Serializable
The Julian day is the Julian day number for the preceding noon plus the fraction of the day (counting 86400 seconds) since that instant.
A Julian day number
is defined as continuous
number associated with the solar day and is zero at Greenwich mean noon on 1st of January 4713 BC.
Important: Julian days are mainly used by astronomers and have nothing to do with
the Julian calendar. See also the authoritative
definition of IAU.
Note: The range of this class is limited to the year range of roughly -2000/+3000 because the precision will strongly decrease beyond those limits.
- Since:
- 3.33/4.28
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
double
Obtains the value of this Julian day as Julian century relative to the year 2000.double
getMJD()
Obtains the value of this Julian day as Modified Julian Date starting at midnight.getScale()
Obtains the underlying time scale.double
getValue()
Obtains the value of this Julian day starting at noon.int
hashCode()
minusDays(double amount)
Subtracts an amount in decimal days from this Julian day.minusSeconds(double amount)
Subtracts an amount in decimal seconds from this Julian day.static JulianDay
ofEphemerisTime(double value)
Creates a Julian day on the time scaleTimeScale.TT
, sometimes also called Julian Ephemeris Day.static JulianDay
ofEphemerisTime(CalendarDate date, PlainTime time, ZonalOffset offset)
Creates a Julian day on the time scaleTimeScale.TT
, sometimes also called Julian Ephemeris Day.static JulianDay
ofEphemerisTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.TT
, sometimes also called Julian Ephemeris Day.static JulianDay
ofMeanSolarTime(double value)
Creates a Julian day on the time scaleTimeScale.UT
, hence related to the mean solar time.static JulianDay
ofMeanSolarTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.UT
, hence related to the mean solar time.static JulianDay
ofSimplifiedTime(double value)
Creates a Julian day on the time scaleTimeScale.POSIX
.static JulianDay
ofSimplifiedTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.POSIX
.plusDays(double amount)
Adds an amount in decimal days to this Julian day.plusSeconds(double amount)
Adds an amount in decimal seconds to this Julian day.toMoment()
Converts this Julian day to aMoment
.toString()
-
Field Details
-
MIN
public static final double MINThe minimum value which corresponds roughly to the year-2000
.- See Also:
- Constant Field Values
-
MAX
public static final double MAXThe maximum value which corresponds roughly to the year+3000
.- See Also:
- Constant Field Values
-
-
Method Details
-
ofEphemerisTime
Creates a Julian day on the time scale
TimeScale.TT
, sometimes also called Julian Ephemeris Day.This kind of Julian day represents the actual astronomical standard. The time TT-2000-01-01T12:00Z corresponds to JD(TT)2451545.0
- Parameters:
value
- floating decimal value in range990575.0 - 2817152.0
- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if given value is not a finite number or out of range
-
ofEphemerisTime
Creates a Julian day on the time scale
TimeScale.TT
, sometimes also called Julian Ephemeris Day.This kind of Julian day represents the actual astronomical standard. The time TT-2000-01-01T12:00Z corresponds to JD(TT)2451545.0
- Parameters:
moment
- corresponding moment- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range
-
ofEphemerisTime
Creates a Julian day on the time scale
TimeScale.TT
, sometimes also called Julian Ephemeris Day.This kind of Julian day represents the actual astronomical standard. The time TT-2000-01-01T12:00Z corresponds to JD(TT)2451545.0
- Parameters:
date
- calendar datetime
- local timeoffset
- timezone offset- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range- Since:
- 3.36/4.31
-
ofMeanSolarTime
Creates a Julian day on the time scale
TimeScale.UT
, hence related to the mean solar time.The conversion to the ephemeris time requires a delta-T-correction.
- Parameters:
value
- floating decimal value in range990575.0 - 2817152.0
- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if given value is not a finite number or out of range
-
ofMeanSolarTime
Creates a Julian day on the time scale
TimeScale.UT
, hence related to the mean solar time.The conversion to the ephemeris time requires a delta-T-correction.
- Parameters:
moment
- corresponding moment- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range
-
ofSimplifiedTime
Creates a Julian day on the time scale
TimeScale.POSIX
.This conversion does not involve a delta-T-correction.
- Parameters:
value
- floating decimal value in range990575.0 - 2817152.0
- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if given value is not a finite number or out of range- Since:
- 3.34/4.29
-
ofSimplifiedTime
Creates a Julian day on the time scale
TimeScale.POSIX
.This conversion does not involve a delta-T-correction.
- Parameters:
moment
- corresponding moment- Returns:
- JulianDay
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range- Since:
- 3.34/4.29
-
getValue
public double getValue()Obtains the value of this Julian day starting at noon.
- Returns:
- double
-
getMJD
public double getMJD()Obtains the value of this Julian day as Modified Julian Date starting at midnight.
- Returns:
- double
- See Also:
EpochDays.MODIFIED_JULIAN_DATE
-
getCenturyJ2000
public double getCenturyJ2000()Obtains the value of this Julian day as Julian century relative to the year 2000.
- Returns:
- Julian century in J2000-frame
- Since:
- 3.36/4.31
-
getScale
Obtains the underlying time scale.
- Returns:
- TimeScale
-
plusDays
Adds an amount in decimal days to this Julian day.
- Parameters:
amount
- the amount in decimal days- Returns:
- new adjusted instance of Julian day with the same time scale
-
minusDays
Subtracts an amount in decimal days from this Julian day.
- Parameters:
amount
- the amount in decimal days- Returns:
- new adjusted instance of Julian day with the same time scale
-
plusSeconds
Adds an amount in decimal seconds to this Julian day.
- Parameters:
amount
- the amount in decimal seconds- Returns:
- new adjusted instance of Julian day with the same time scale
-
minusSeconds
Subtracts an amount in decimal seconds from this Julian day.
- Parameters:
amount
- the amount in decimal seconds- Returns:
- new adjusted instance of Julian day with the same time scale
-
equals
-
hashCode
public int hashCode() -
toString
-
toMoment
Converts this Julian day to a
Moment
.- Returns:
- Moment
-