Class mjDate

java.lang.Object
uk.ac.starlink.pal.mjDate

public class mjDate extends Object
Modified Julian Date
  • Constructor Details

    • mjDate

      public mjDate(int yr, int mn, int d) throws palError
      Modified Julian Date
      Parameters:
      yr - Year
      mn - Month
      d - Day
      Throws:
      palError
    • mjDate

      public mjDate(int yr, int mn, int d, double fract) throws palError
      Modified Julian Date
      Parameters:
      yr - Year
      mn - Month
      d - Day
      fract - Fraction of day
      Throws:
      palError
    • mjDate

      public mjDate(int yr, int diy) throws palError
      Modified Julian Date
      Parameters:
      yr - Year
      diy - Day in year
      Throws:
      palError
  • Method Details

    • getYear

      public int getYear()
      Get year
      Returns:
      Year
    • getMonth

      public int getMonth()
      Get month
      Returns:
      Month
    • getDay

      public int getDay()
      Get day
      Returns:
      Day
    • getFraction

      public int getFraction(int n)
      Get fraction as integer number of places.
      Returns:
      fraction * 10^n
    • getFraction

      public double getFraction()
      Get fraction
      Returns:
      Fraction of day
    • getDayinYear

      public int getDayinYear()
      Get day in year
      Returns:
      Day in year
    • toString

      public String toString(int n)
      return date as string to required precision
      Parameters:
      n - Number of decimal places in fraction
      Returns:
      Date in form YYYY MM DD.F
    • toString

      public String toString()
      return date as string
      Overrides:
      toString in class Object
      Returns:
      Date in form dd/mm/yyyy