# Class mjDate

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

public class mjDate extends Object
Modified Julian Date

## Constructor Summary

Constructors
Constructor
Description
`mjDate(int yr, int diy)`
Modified Julian Date
`mjDate(int yr, int mn, int d)`
Modified Julian Date
`mjDate(int yr, int mn, int d, double fract)`
Modified Julian Date

## Method Summary

Modifier and Type
Method
Description
`int`
`getDay()`
Get day
`int`
`getDayinYear()`
Get day in year
`double`
`getFraction()`
Get fraction
`int`
`getFraction(int n)`
Get fraction as integer number of places.
`int`
`getMonth()`
Get month
`int`
`getYear()`
Get year
`String`
`toString()`
return date as string
`String`
`toString(int n)`
return date as string to required precision

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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