# JulianDate

#### new Cesium.JulianDate(julianDayNumber, secondsOfDay, timeStandard)
Core/JulianDate.js 207

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`.

Name | Type | Default | Description
--- | --- | --- | ---
`julianDayNumber` | Number | `0.0` | optional The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
`secondsOfDay` | Number | `0.0` | optional The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.
`timeStandard` | TimeStandard | `TimeStandard.UTC` | optional The time standard in which the first two parameters are defined.

### Members

#### static Cesium.JulianDate.leapSeconds : Array.<LeapSecond>
Core/JulianDate.js 1202

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

#### dayNumber : Number
Core/JulianDate.js 212

Gets or sets the number of whole days.

#### secondsOfDay : Number
Core/JulianDate.js 218

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

### Methods

#### static Cesium.JulianDate.addDays(julianDate, days, result) → JulianDate
Core/JulianDate.js 1093

Adds the provided number of days to the provided date instance.

Name | Type | Description
--- | --- | ---
`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:

The modified result parameter.

#### static Cesium.JulianDate.addHours(julianDate, hours, result) → JulianDate
Core/JulianDate.js 1067

Adds the provided number of hours to the provided date instance.

Name | Type | Description
--- | --- | ---
`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:

The modified result parameter.

#### static Cesium.JulianDate.addMinutes(julianDate, minutes, result) → JulianDate
Core/JulianDate.js 1041

Adds the provided number of minutes to the provided date instance.

Name | Type | Description
--- | --- | ---
`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:

The modified result parameter.

#### static Cesium.JulianDate.addSeconds(julianDate, seconds, result) → JulianDate
Core/JulianDate.js 1013

Adds the provided number of seconds to the provided date instance.

Name | Type | Description
--- | --- | ---
`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:

The modified result parameter.

#### static Cesium.JulianDate.clone(julianDate, result) → JulianDate
Core/JulianDate.js 839

Duplicates a JulianDate instance.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date to duplicate.
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

#### static Cesium.JulianDate.compare(left, right) → Number
Core/JulianDate.js 862

Compares two instances.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

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 Cesium.JulianDate.computeTaiMinusUtc(julianDate) → Number
Core/JulianDate.js 987

Computes the number of seconds the provided instance is ahead of UTC.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date.

##### Returns:

The number of seconds the provided instance is ahead of UTC

#### static Cesium.JulianDate.daysDifference(left, right) → Number
Core/JulianDate.js 965

Computes the difference in days between the provided instance.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

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

#### static Cesium.JulianDate.equals(left, right) → Boolean
Core/JulianDate.js 886

Compares two instances and returns `true` if they are equal, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | optional The first instance.
`right` | JulianDate | optional The second instance.

##### Returns:

`true` if the dates are equal; otherwise, `false`.

#### static Cesium.JulianDate.equalsEpsilon(left, right, epsilon) → Boolean
Core/JulianDate.js 907

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`.

Name | Type | Default | Description
--- | --- | --- | ---
`left` | JulianDate |  | optional The first instance.
`right` | JulianDate |  | optional The second instance.
`epsilon` | Number | `0` | optional The maximum number of seconds that should separate the two instances.

##### Returns:

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

#### static Cesium.JulianDate.fromDate(date, result) → JulianDate
Core/JulianDate.js 279

Creates a new instance from a JavaScript Date.

Name | Type | Description
--- | --- | ---
`date` | Date | A JavaScript Date.
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

##### Throws:

- DeveloperError : date must be a valid JavaScript Date.

#### static Cesium.JulianDate.fromGregorianDate(date, result) → JulianDate
Core/JulianDate.js 246

Creates a new instance from a GregorianDate.

Name | Type | Description
--- | --- | ---
`date` | GregorianDate | A GregorianDate.
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

##### Throws:

- DeveloperError : date must be a valid GregorianDate.

#### static Cesium.JulianDate.fromIso8601(iso8601String, result) → JulianDate
Core/JulianDate.js 314

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.

Name | Type | Description
--- | --- | ---
`iso8601String` | String | An ISO 8601 date.
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

##### Throws:

- DeveloperError : Invalid ISO 8601 date.

#### static Cesium.JulianDate.greaterThan(left, right) → Boolean
Core/JulianDate.js 1139

Compares the provided instances and returns `true` if `left` is later than `right`, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

`true` if `left` is later than `right`, `false` otherwise.

#### static Cesium.JulianDate.greaterThanOrEquals(left, right) → Boolean
Core/JulianDate.js 1150

Compares the provided instances and returns `true` if `left` is later than or equal to `right`, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

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

#### static Cesium.JulianDate.lessThan(left, right) → Boolean
Core/JulianDate.js 1117

Compares the provided instances and returns `true` if `left` is earlier than `right`, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

`true` if `left` is earlier than `right`, `false` otherwise.

#### static Cesium.JulianDate.lessThanOrEquals(left, right) → Boolean
Core/JulianDate.js 1128

Compares the provided instances and returns `true` if `left` is earlier than or equal to `right`, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

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

#### static Cesium.JulianDate.now(result) → JulianDate
Core/JulianDate.js 616

Creates a new instance that represents the current system time. This is equivalent to calling `JulianDate.fromDate(new Date());`.

Name | Type | Description
--- | --- | ---
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

#### static Cesium.JulianDate.secondsDifference(left, right) → Number
Core/JulianDate.js 943

Computes the difference in seconds between the provided instance.

Name | Type | Description
--- | --- | ---
`left` | JulianDate | The first instance.
`right` | JulianDate | The second instance.

##### Returns:

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

#### static Cesium.JulianDate.toDate(julianDate) → Date
Core/JulianDate.js 720

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.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date to be converted.

##### Returns:

A new instance representing the provided date.

#### static Cesium.JulianDate.toGregorianDate(julianDate, result) → GregorianDate
Core/JulianDate.js 629

Creates a `GregorianDate` from the provided instance.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date to be converted.
`result` | GregorianDate | optional An existing instance to use for the result.

##### Returns:

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

#### static Cesium.JulianDate.toIso8601(julianDate, precision) → String
Core/JulianDate.js 752

Creates an ISO8601 representation of the provided date.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date to be converted.
`precision` | Number | optional The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.

##### Returns:

The ISO8601 representation of the provided date.

#### static Cesium.JulianDate.totalDays(julianDate) → Number
Core/JulianDate.js 924

Computes the total number of whole and fractional days represented by the provided instance.

Name | Type | Description
--- | --- | ---
`julianDate` | JulianDate | The date.

##### Returns:

The Julian date as single floating point number.

#### clone(result) → JulianDate
Core/JulianDate.js 1160

Duplicates this instance.

Name | Type | Description
--- | --- | ---
`result` | JulianDate | optional An existing instance to use for the result.

##### Returns:

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

#### equals(right) → Boolean
Core/JulianDate.js 1170

Compares this and the provided instance and returns `true` if they are equal, `false` otherwise.

Name | Type | Description
--- | --- | ---
`right` | JulianDate | optional The second instance.

##### Returns:

`true` if the dates are equal; otherwise, `false`.

#### equalsEpsilon(right, epsilon) → Boolean
Core/JulianDate.js 1184

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`.

Name | Type | Default | Description
--- | --- | --- | ---
`right` | JulianDate |  | optional The second instance.
`epsilon` | Number | `0` | optional The maximum number of seconds that should separate the two instances.

##### Returns:

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

#### toString() → String
Core/JulianDate.js 1193

Creates a string representing this date in ISO8601 format.

##### Returns:

A string representing this date in ISO8601 format.