JulianDate

external class JulianDate(julianDayNumber: Double? = definedExternally, var secondsOfDay: Double = definedExternally, timeStandard: TimeStandard? = definedExternally)(source)

Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC). For increased precision, this class stores the whole number part of the date and the seconds part of the date in separate components. In order to be safe for arithmetic and represent leap seconds, the date is always stored in the International Atomic Time standard TimeStandard.TAI.

Parameters

julianDayNumber

The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly. Default value - 0.0

timeStandard

The time standard in which the first two parameters are defined. Default value - TimeStandard.UTC

See also

Constructors

Link copied to clipboard
constructor(julianDayNumber: Double? = definedExternally, secondsOfDay: Double = definedExternally, timeStandard: TimeStandard? = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Gets or sets the number of whole days.

Link copied to clipboard

The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly. Default value - 0.0

Functions

Link copied to clipboard
fun clone(result: JulianDate? = definedExternally): JulianDate

Duplicates this instance.

Link copied to clipboard
fun equalsEpsilon(right: JulianDate? = definedExternally, epsilon: Double? = definedExternally): Boolean

Compares this and the provided instance and returns true if they are within epsilon seconds of each other. That is, in order for the dates to be considered equal (and for this function to return true), the absolute value of the difference between them, in seconds, must be less than epsilon.