Package uk.ac.starlink.pal
Class mjDate
- java.lang.Object
-
- uk.ac.starlink.pal.mjDate
-
public class mjDate extends java.lang.Object
Modified Julian Date
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDay()
Get dayint
getDayinYear()
Get day in yeardouble
getFraction()
Get fractionint
getFraction(int n)
Get fraction as integer number of places.int
getMonth()
Get monthint
getYear()
Get yearjava.lang.String
toString()
return date as stringjava.lang.String
toString(int n)
return date as string to required precision
-
-
-
Constructor Detail
-
mjDate
public mjDate(int yr, int mn, int d) throws palError
Modified Julian Date- Parameters:
yr
- Yearmn
- Monthd
- Day- Throws:
palError
-
mjDate
public mjDate(int yr, int mn, int d, double fract) throws palError
Modified Julian Date- Parameters:
yr
- Yearmn
- Monthd
- Dayfract
- Fraction of day- Throws:
palError
-
-
Method Detail
-
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 java.lang.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 java.lang.String toString()
return date as string- Overrides:
toString
in classjava.lang.Object
- Returns:
- Date in form dd/mm/yyyy
-
-