JulianDate lastDate = getDateForIndex(index); JulianDate taiCutoff = new JulianDate(lastDate.getDay(), lastDate.getSecondsOfDay(), TimeStandard.INTERNATIONAL_ATOMIC_TIME); taiCutoff = JulianDate.add(taiCutoff, Duration.fromSeconds(getOffsetForIndex(index))); if (JulianDate.lessThan(date, taiCutoff)) { --index; return getOffsetForIndex(index);
double mostRecentOffset = getOffsetForIndex(index); JulianDate leapSecondDate = getDateForIndex(index); if (date.getDay() == leapSecondDate.getDay()) { result[0] = new JulianDate(date.getDay(), date.getSecondsOfDay() - getOffsetForIndex(index), TimeStandard.COORDINATED_UNIVERSAL_TIME); return true;