Package uk.ac.starlink.pal
Class mjDate
- java.lang.Object
-
- uk.ac.starlink.pal.mjDate
-
public class mjDate extends java.lang.ObjectModified Julian Date
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDay()Get dayintgetDayinYear()Get day in yeardoublegetFraction()Get fractionintgetFraction(int n)Get fraction as integer number of places.intgetMonth()Get monthintgetYear()Get yearjava.lang.StringtoString()return date as stringjava.lang.StringtoString(int n)return date as string to required precision
-
-
-
Constructor Detail
-
mjDate
public mjDate(int yr, int mn, int d) throws palErrorModified Julian Date- Parameters:
yr- Yearmn- Monthd- Day- Throws:
palError
-
mjDate
public mjDate(int yr, int mn, int d, double fract) throws palErrorModified 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:
toStringin classjava.lang.Object- Returns:
- Date in form dd/mm/yyyy
-
-