/** * Returns the days between two dates. Positive values indicate that * the second date is after the first, and negative values indicate, well, * the opposite. * * @param early * @param late * @return the days between two dates. * @deprecated */ public static final int daysBetween(Calendar early, Calendar late) { return (int) (toJulian(late) - toJulian(early)); }
/** * Returns the days between two dates. Positive values indicate that * the second date is after the first, and negative values indicate, well, * the opposite. * * @param early * @param late * @return the days between two dates. * @deprecated */ public static final int daysBetween(Calendar early, Calendar late) { return (int) (toJulian(late) - toJulian(early)); }
/** * Return a Julian date based on the input parameter. This is * based from calculations found at * <a href="http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html">Julian Day Calculations * (Gregorian Calendar)</a>, provided by Bill Jeffrys. * @param date * @return the julian day number */ public static final float toJulian(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); return toJulian(c); }
/** * Return a Julian date based on the input parameter. This is * based from calculations found at * <a href="http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html">Julian Day Calculations * (Gregorian Calendar)</a>, provided by Bill Jeffrys. * @param date * @return the julian day number */ public static final float toJulian(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); return toJulian(c); }