Class

JulianDay

JulianDay(num)

A Julian Day class. A Julian Day is a date based on the Julian Day count of time invented by Joseph Scaliger in 1583 for use with astronomical calculations. Do not confuse it with a date in the Julian calendar, which it has very little in common with. The naming is unfortunately close, and comes from history.

Constructor

# new JulianDay(num)

Parameters:
Name Type Description
num number

the Julian Day expressed as a floating point number

View Source JulianDay.js, line 31

Methods

# addDate(offset)

Add an offset to the current date instance. The offset should be expressed in terms of Julian days. That is, each integral unit represents one day of time, and fractional part represents a fraction of a regular 24-hour day.

Parameters:
Name Type Description
offset number

an amount to add (or subtract) to the current result instance.

View Source JulianDay.js, line 104

# getDate() → {number}

Return the Julian Day expressed as a floating point number.

View Source JulianDay.js, line 84

the Julian Day as a number

number

# getDayFraction()

Return the fractional portion of this Julian Day instance. This portion corresponds to the time of day for the instance.

View Source JulianDay.js, line 62

# getDays() → {number}

Return the integral portion of this Julian Day instance. This corresponds to the number of days since the beginning of the epoch.

View Source JulianDay.js, line 44

the integral portion of this Julian Day

number

# setDate(num)

Set the date of this Julian Day instance.

Parameters:
Name Type Description
num number

the numeric Julian Day to set into this instance

View Source JulianDay.js, line 93

# setDayFraction(fraction)

Set the fractional part of the Julian Day. The fractional part represents the portion of a fully day. Julian dates start at noon, and proceed until noon of the next day. That would mean midnight is represented as a fractional part of 0.5.

Parameters:
Name Type Description
fraction number

The fractional part of the Julian date

View Source JulianDay.js, line 74

# setDays(days)

Set the date of this Julian Day instance.

Parameters:
Name Type Description
days number

the julian date expressed as a floating point number

View Source JulianDay.js, line 53