code: public static double getJulianDayNumber(Calendar time) {
  
          if (time == null) {
              time = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
          }
  
          double jd = BASE_JD + time.getTimeInMillis() / MILLISEC_PER_DAY;
  
          return jd;
      }
docs: Calculate the Julian day number corresponding to the time provided
  
  @param time
  , the time for which the Julian Day number is required. If
  null, the current time will be used.
  
  @return - the Julian day number corresponding to the supplied time