Calendrical v0.1.1 Calendrical.JulianDay View Source

Converts %Date{} to and from a Julian Day (which is not the same thing as a day in the Julian Calendar). Also converts to and from Modified Julian Day.

The Julian Day Count is a uniform count of days from a remote epoch in the past (-4712 January 1, 12 hours Greenwich Mean Time (Julian proleptic Calendar) = 4713 BCE January 1, 12 hours GMT (Julian proleptic Calendar) = 4714 BCE November 24, 12 hours GMT (Gregorian proleptic Calendar)). At this instant, the Julian Day Number is 0. It is convenient for astronomers to use since it is not necessary to worry about odd numbers of days in a month, leap years, etc. Once you have the Julian Day Number of a particular date in history, it is easy to calculate time elapsed between it and any other Julian Day Number.

The Julian Day Count has nothing to do with the Julian Calendar introduced by Julius Caesar.

Scaliger chose the particular date in the remote past because it was before recorded history and because in that year, three important cycles coincided with their first year of the cycle: The 19-year Metonic Cycle, the 15-year Indiction Cycle (a Roman Taxation Cycle) and the 28-year Solar Cycle (the length of time for the old Julian Calendar to repeat exactly).

Link to this section Summary

Functions

Convert a modified julian day to a %Date{}

Convert a %Date{} to a julian day

Convert a %Date{} to a modified julian day

Returns the epoch for the Julian Day as a rata die

Convert a rata die to a julian day

Returns the epoch for the Modified Julian Day as a rata die

Convert a rata die to a modified julian day

Convert a julian day to a rata die

Convert a modified julian day to a rata die

Link to this section Functions

Link to this function date_from_julian_day(julian_day, calendar \\ Calendar.ISO) View Source

Convert a julian day to a %Date{}

Example

iex> Calendrical.JulianDay.date_from_julian_day(2457934.5)
~D[2017-06-30]
Link to this function date_from_modified_julian_day(julian_day, calendar \\ Calendar.ISO) View Source

Convert a modified julian day to a %Date{}

Example

iex> Calendrical.JulianDay.date_from_modified_julian_day(57934.0)
~D[2017-06-30]
Link to this function date_to_julian_day(date) View Source

Convert a %Date{} to a julian day

Example

iex> Calendrical.JulianDay.date_to_julian_day(~D[2017-06-30])
2457934.5
Link to this function date_to_julian_day(year, month, day, calendar \\ Calendar.ISO) View Source
Link to this function date_to_modified_julian_day(date) View Source

Convert a %Date{} to a modified julian day

Example

iex> Calendrical.JulianDay.date_to_modified_julian_day(~D[2017-06-30])
57934.0
Link to this function date_to_modified_julian_day(year, month, day, calendar \\ Calendar.ISO) View Source

Returns the epoch for the Julian Day as a rata die.

Link to this function julian_day_from_rata_die(rata_die) View Source

Convert a rata die to a julian day

Returns the epoch for the Modified Julian Day as a rata die.

Link to this function modified_julian_day_from_rata_die(rata_die) View Source

Convert a rata die to a modified julian day

Link to this function rata_die_from_julian_day(jd) View Source

Convert a julian day to a rata die

Link to this function rata_die_from_modified_julian_day(mjd) View Source

Convert a modified julian day to a rata die