Class JulianDay

java.lang.Object
net.time4j.calendar.astro.JulianDay
All Implemented Interfaces:
Serializable

public final class JulianDay extends Object implements 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 Details

    • MIN

      public static final double MIN
      The minimum value which corresponds roughly to the year -2000.
      See Also:
      Constant Field Values
    • MAX

      public static final double MAX
      The maximum value which corresponds roughly to the year +3000.
      See Also:
      Constant Field Values
  • Method Details

    • ofEphemerisTime

      public static JulianDay ofEphemerisTime(double value)

      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 range 990575.0 - 2817152.0
      Returns:
      JulianDay
      Throws:
      IllegalArgumentException - if given value is not a finite number or out of range
    • ofEphemerisTime

      public static JulianDay ofEphemerisTime(Moment moment)

      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

      public static JulianDay ofEphemerisTime(CalendarDate date, PlainTime time, ZonalOffset offset)

      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 date
      time - local time
      offset - timezone offset
      Returns:
      JulianDay
      Throws:
      IllegalArgumentException - if the Julian day of moment is not in supported range
      Since:
      3.36/4.31
    • ofMeanSolarTime

      public static JulianDay ofMeanSolarTime(double value)

      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 range 990575.0 - 2817152.0
      Returns:
      JulianDay
      Throws:
      IllegalArgumentException - if given value is not a finite number or out of range
    • ofMeanSolarTime

      public static JulianDay ofMeanSolarTime(Moment moment)

      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

      public static JulianDay ofSimplifiedTime(double value)

      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 range 990575.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

      public static JulianDay ofSimplifiedTime(Moment moment)

      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

      public TimeScale getScale()

      Obtains the underlying time scale.

      Returns:
      TimeScale
    • plusDays

      public JulianDay plusDays(double amount)

      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

      public JulianDay minusDays(double amount)

      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

      public JulianDay plusSeconds(double amount)

      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

      public JulianDay minusSeconds(double amount)

      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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toMoment

      public Moment toMoment()

      Converts this Julian day to a Moment.

      Returns:
      Moment