LeapSecond

new LeapSecond(date, offset)

Describes a single leap second, which is constructed from a JulianDate and a numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
Name Type Description
date JulianDate A Julian date representing the time of the leap second.
offset Number The cumulative number of seconds, that TAI is ahead of UTC at provided date.
Example:
// Example 1. Construct a LeapSecond using a JulianDate
var date = new Date('January 1, 1990 00:00:00 UTC');
var leapSecond = new Cesium.LeapSecond(Cesium.JulianDate.fromDate(date), 25.0);
var offset = leapSecond.offset;    // 25.0

//////////////////////////////////////////////////////////////////

// Example 2. Construct a LeapSecond using a date string
var date = 'January 1, 1990 00:00:00 UTC';
var leapSecond = new LeapSecond(date, 25.0);
See:

Members

staticLeapSecond.leapSeconds :LeapSecond[]

The list of leap seconds used throughout Cesium.

julianDate :JulianDate

The Julian date at which this leap second occurs.

offset :Number

The cumulative number of seconds between the UTC and TAI time standards at the time of this leap second.

Methods

staticLeapSecond.compareLeapSecondDate(leapSecond1, leapSecond2)Number

Given two leap seconds, determines which comes before the other by comparing their respective Julian dates.
Name Type Description
leapSecond1 LeapSecond The first leap second to be compared.
leapSecond2 LeapSecond The second leap second to be compared.
Returns:
A negative value if the first leap second is earlier than the second, a positive value if the first leap second is later than the second, or zero if the two leap seconds are equal (ignoring their offsets).
Example:
var date = new Date('January 1, 2006 00:00:00 UTC');
var leapSecond1 = new Cesium.LeapSecond(Cesium.JulianDate.fromDate(date), 33.0);
var leapSecond2 = new Cesium.LeapSecond(Cesium.JulianDate.fromDate(date), 34.0);
Cesium.LeapSecond.compareLeapSecondDate(leapSecond1, leapSecond2);    // returns 0
See:

equals(other)Boolean

Checks whether two leap seconds are equivalent to each other.
Name Type Description
other LeapSecond The leap second to compare against.
Returns:
true if the leap seconds are equal; otherwise, false.
Example:
var date = new Date('January 1, 1990 00:00:00 UTC');
var leapSecond1 = new Cesium.LeapSecond(Cesium.JulianDate.fromDate(date), 25.0);
var leapSecond2 = new Cesium.LeapSecond(Cesium.JulianDate.fromDate(date), 25.0);
leapSecond1.equals(leapSecond2);     // true