code: public static Calendar getJavaCalendar(final double excelDate, final boolean use1904windowing) {
          if (isValidExcelDate(excelDate)) {
              int startYear = EXCEL_BASE_YEAR;
              int dayAdjust = -1; // Excel thinks 2/29/1900 is a valid date, which
              // it isn't
              final int wholeDays = (int) Math.floor(excelDate);
              if (use1904windowing) {
                  startYear = EXCEL_WINDOWING_1904;
                  dayAdjust = 1; // 1904 date windowing uses 1/2/1904 as the
                  // first day
              } else if (wholeDays < EXCEL_FUDGE_19000229) {
                  // Date is prior to 3/1/1900, so adjust because Excel thinks
                  // 2/29/1900 exists
                  // If Excel date == 2/29/1900, will become 3/1/1900 in Java
                  // representation
                  dayAdjust = 0;
              }
              final GregorianCalendar calendar = new GregorianCalendar(startYear, 0, wholeDays + dayAdjust);
              final int millisecondsInDay = (int) ((excelDate - Math.floor(excelDate)) * DAY_MILLISECONDS + HALF_MILLISEC);
              calendar.set(Calendar.MILLISECOND, millisecondsInDay);
              return calendar;
          } else {
              return null;
          }
  
      }
docs: Given an Excel date with either 1900 or 1904 date windowing, converts it
  to a java.util.Date.
  
  @param excelDate
  The Excel date.
  @param use1904windowing
  true if date uses 1904 windowing, or false if using 1900 date
  windowing.
  @return Java representation of the date without any time.
  
  @see java.util.TimeZone