Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • JulianDate
    • JulianDate

Index

Constructors

constructor

  • new JulianDate(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: UTC | TAI): JulianDate
  • Parameters

    • Optional julianDayNumber: number
    • Optional secondsOfDay: number
    • Optional timeStandard: UTC | TAI

    Returns JulianDate

Properties

dayNumber

dayNumber: number

Gets or sets the number of whole days.

secondsOfDay

secondsOfDay: number

Gets or sets the number of seconds into the current day.

Static leapSeconds

leapSeconds: LeapSecond[]

Gets or sets the list of leap seconds used throughout Cesium.

Methods

clone

  • clone(result?: JulianDate): JulianDate
  • Duplicates this instance.

    Parameters

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided.

equals

  • equals(right?: JulianDate): boolean
  • Compares this and the provided instance and returns true if they are equal, false otherwise.

    Parameters

    • Optional right: JulianDate

    Returns boolean

    true if the dates are equal; otherwise, false.

equalsEpsilon

  • equalsEpsilon(right?: JulianDate, epsilon?: number): 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.

    Parameters

    • Optional right: JulianDate
    • Optional epsilon: number

    Returns boolean

    true if the two dates are within epsilon seconds of each other; otherwise false.

toString

  • toString(): string
  • Creates a string representing this date in ISO8601 format.

    Returns string

    A string representing this date in ISO8601 format.

Static addDays

  • addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate
  • Adds the provided number of days to the provided date instance.

    Parameters

    • julianDate: JulianDate

      The date.

    • days: number

      The number of days to add or subtract.

    • result: JulianDate

      An existing instance to use for the result.

    Returns JulianDate

    The modified result parameter.

Static addHours

  • addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate
  • Adds the provided number of hours to the provided date instance.

    Parameters

    • julianDate: JulianDate

      The date.

    • hours: number

      The number of hours to add or subtract.

    • result: JulianDate

      An existing instance to use for the result.

    Returns JulianDate

    The modified result parameter.

Static addMinutes

  • addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate
  • Adds the provided number of minutes to the provided date instance.

    Parameters

    • julianDate: JulianDate

      The date.

    • minutes: number

      The number of minutes to add or subtract.

    • result: JulianDate

      An existing instance to use for the result.

    Returns JulianDate

    The modified result parameter.

Static addSeconds

  • addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate
  • Adds the provided number of seconds to the provided date instance.

    Parameters

    • julianDate: JulianDate

      The date.

    • seconds: number

      The number of seconds to add or subtract.

    • result: JulianDate

      An existing instance to use for the result.

    Returns JulianDate

    The modified result parameter.

Static clone

  • clone(julianDate: JulianDate, result?: JulianDate): JulianDate
  • Duplicates a JulianDate instance.

    Parameters

    • julianDate: JulianDate

      The date to duplicate.

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.

Static compare

  • compare(left: JulianDate, right: JulianDate): number
  • Compares two instances.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns number

    A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.

Static computeTaiMinusUtc

  • computeTaiMinusUtc(julianDate: JulianDate): number
  • Computes the number of seconds the provided instance is ahead of UTC.

    Parameters

    • julianDate: JulianDate

      The date.

    Returns number

    The number of seconds the provided instance is ahead of UTC

Static daysDifference

  • daysDifference(left: JulianDate, right: JulianDate): number
  • Computes the difference in days between the provided instance.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns number

    The difference, in days, when subtracting right from left.

Static equals

  • equals(left?: JulianDate, right?: JulianDate): boolean
  • Compares two instances and returns true if they are equal, false otherwise.

    Parameters

    • Optional left: JulianDate
    • Optional right: JulianDate

    Returns boolean

    true if the dates are equal; otherwise, false.

Static equalsEpsilon

  • equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean
  • Compares two instances 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.

    Parameters

    • Optional left: JulianDate
    • Optional right: JulianDate
    • Optional epsilon: number

    Returns boolean

    true if the two dates are within epsilon seconds of each other; otherwise false.

Static fromDate

  • fromDate(date: Date, result?: JulianDate): JulianDate
  • Creates a new instance from a JavaScript Date.

    Parameters

    • date: Date

      A JavaScript Date.

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided.

Static fromGregorianDate

  • fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate
  • Creates a new instance from a GregorianDate.

    Parameters

    • date: GregorianDate

      A GregorianDate.

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided.

Static fromIso8601

  • fromIso8601(iso8601String: string, result?: JulianDate): JulianDate
  • Creates a new instance from a from an ISO 8601 date. This method is superior to Date.parse because it will handle all valid formats defined by the ISO 8601 specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.

    Parameters

    • iso8601String: string

      An ISO 8601 date.

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided.

Static greaterThan

  • greaterThan(left: JulianDate, right: JulianDate): boolean
  • Compares the provided instances and returns true if left is later than right, false otherwise.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns boolean

    true if left is later than right, false otherwise.

Static greaterThanOrEquals

  • greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean
  • Compares the provided instances and returns true if left is later than or equal to right, false otherwise.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns boolean

    true if left is later than or equal to right, false otherwise.

Static lessThan

  • lessThan(left: JulianDate, right: JulianDate): boolean
  • Compares the provided instances and returns true if left is earlier than right, false otherwise.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns boolean

    true if left is earlier than right, false otherwise.

Static lessThanOrEquals

  • lessThanOrEquals(left: JulianDate, right: JulianDate): boolean
  • Compares the provided instances and returns true if left is earlier than or equal to right, false otherwise.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns boolean

    true if left is earlier than or equal to right, false otherwise.

Static now

  • now(result?: JulianDate): JulianDate
  • Creates a new instance that represents the current system time. This is equivalent to calling JulianDate.fromDate(new Date());.

    Parameters

    • Optional result: JulianDate

    Returns JulianDate

    The modified result parameter or a new instance if none was provided.

Static secondsDifference

  • secondsDifference(left: JulianDate, right: JulianDate): number
  • Computes the difference in seconds between the provided instance.

    Parameters

    • left: JulianDate

      The first instance.

    • right: JulianDate

      The second instance.

    Returns number

    The difference, in seconds, when subtracting right from left.

Static toDate

  • toDate(julianDate: JulianDate): Date
  • Creates a JavaScript Date from the provided instance. Since JavaScript dates are only accurate to the nearest millisecond and cannot represent a leap second, consider using JulianDate.toGregorianDate instead. If the provided JulianDate is during a leap second, the previous second is used.

    Parameters

    • julianDate: JulianDate

      The date to be converted.

    Returns Date

    A new instance representing the provided date.

Static toGregorianDate

  • toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate
  • Creates a {@link GregorianDate} from the provided instance.

    Parameters

    • julianDate: JulianDate

      The date to be converted.

    • Optional result: GregorianDate

    Returns GregorianDate

    The modified result parameter or a new instance if none was provided.

Static toIso8601

  • toIso8601(julianDate: JulianDate, precision?: number): string
  • Creates an ISO8601 representation of the provided date.

    Parameters

    • julianDate: JulianDate

      The date to be converted.

    • Optional precision: number

    Returns string

    The ISO8601 representation of the provided date.

Static totalDays

  • totalDays(julianDate: JulianDate): number
  • Computes the total number of whole and fractional days represented by the provided instance.

    Parameters

    • julianDate: JulianDate

      The date.

    Returns number

    The Julian date as single floating point number.