code: private static double gregorianToJD(int year, int month, int date) {
         double JULIAN_EPOCH = 1721425.5;
         int y = year - 1;
         int result = (365 * y)
                    + (y / 4)
                    - (y / 100)
                    + (y / 400)
                    + (((367 * month) - 362) / 12)
                    + ((month <= 2) ? 0 : (isGregorianLeap(year) ? -1 : -2))
                    + date;
         return result - 1 + JULIAN_EPOCH;
      }
docs: /*
  The following function is not needed for basic calendar functioning.
  This routine converts a gregorian date to the corresponding Julian date"
  @param year   The year in standard Gregorian calendar (AD/BC) .
  @param month  The month according to Gregorian calendar (between 0 to 11)
  @param date   The date in month