/** * Computes the number of days that have elapsed from this Julian date to the {@code other} Julian date. * <p> This method subtracts the Julian date on which it is called from the {@code other} Julian date and returns the number of days between them. The computation is done in the time standard of this Julian date, or the closest standard that is safe for arithmetic if this Julian date's time standard is not safe. For best performance, this Julian date and the {@code other} Julian date should have the same time standard and it should be safe for arithmetic. * @param other The other Julian date, which is the end of the interval. * @return The number of days that have elapsed from this Julian date to the other Julian date. */ @CS2JWarning("Unhandled attribute removed: Pure") public final double daysDifference(@Nonnull JulianDate other) { JulianDate start = toInternationalAtomicTime(); JulianDate end = other.toInternationalAtomicTime(); long startDay = start.getDay(); long endDay = end.getDay(); return endDay - startDay + (end.getSecondsOfDay() - start.getSecondsOfDay()) / TimeConstants.SecondsPerDay; }
/** * Computes the number of seconds that have elapsed from this Julian date to the {@code other} Julian date. * <p> This method subtracts the Julian date on which it is called from the {@code other} Julian date and returns the number of seconds between them. The computation is done in the time standard of this Julian date, or the closest standard that is safe for arithmetic if this Julian date's time standard is not safe. For best performance, this Julian date and the {@code other} Julian date should have the same time standard and it should be safe for arithmetic. * @param other The other Julian date, which is the end of the interval. * @return The number of seconds that have elapsed from this Julian date to the other Julian date. */ @CS2JWarning("Unhandled attribute removed: Pure") public final double secondsDifference(@Nonnull JulianDate other) { JulianDate start = toInternationalAtomicTime(); JulianDate end = other.toInternationalAtomicTime(); long startDay = start.getDay(); long endDay = end.getDay(); return (endDay - startDay) * TimeConstants.SecondsPerDay + (end.getSecondsOfDay() - start.getSecondsOfDay()); }
/** * Computes the number of minutes that have elapsed from this Julian date to the {@code other} Julian date. * <p> This method subtracts the Julian date on which it is called from the {@code other} Julian date and returns the number of minutes between them. The computation is done in the time standard of this Julian date, or the closest standard that is safe for arithmetic if this Julian date's time standard is not safe. For best performance, this Julian date and the {@code other} Julian date should have the same time standard and it should be safe for arithmetic. * @param other The other Julian date, which is the end of the interval. * @return The number of minutes that have elapsed from this Julian date to the other Julian date. */ @CS2JWarning("Unhandled attribute removed: Pure") public final double minutesDifference(@Nonnull JulianDate other) { JulianDate start = toInternationalAtomicTime(); JulianDate end = other.toInternationalAtomicTime(); long startDay = start.getDay(); long endDay = end.getDay(); return (endDay - startDay) * TimeConstants.MinutesPerDay + (end.getSecondsOfDay() - start.getSecondsOfDay()) / TimeConstants.SecondsPerMinute; }
if (subtractionTimeStandard != getStandard() && subtractionTimeStandard != subtrahend.getStandard()) { return toInternationalAtomicTime().subtractIgnoringTimeStandard(subtrahend.toInternationalAtomicTime()); return toInternationalAtomicTime().subtractIgnoringTimeStandard(subtrahend); return subtractIgnoringTimeStandard(subtrahend.toInternationalAtomicTime());
if (additionTimeStandard != getStandard()) { JulianDate resultInAdditionStandard = toInternationalAtomicTime().addIgnoringTimeStandard(duration);
} else { self = toInternationalAtomicTime(); otherDate = other.toInternationalAtomicTime();