public static int convertDateToProleptic(int hybrid) {
    int proleptic = hybrid;
    if (hybrid < SWITCHOVER_DAYS) {
      String dateStr = HYBRID_DATE_FORMAT.get().format(
          new Date(TimeUnit.DAYS.toMillis(hybrid)));
      try {
        proleptic = (int) TimeUnit.MILLISECONDS.toDays(
            PROLEPTIC_DATE_FORMAT.get().parse(dateStr).getTime());
      } catch (ParseException e) {
        throw new IllegalArgumentException("Can't parse " + dateStr, e);
      }
    }
    return proleptic;
  }
Convert an epoch day from the hybrid Julian/Gregorian calendar to the
proleptic Gregorian.
@param hybrid day of epoch in the hybrid Julian/Gregorian
@return day of epoch in the proleptic Gregorian
storage-api/src/java/org/apache/hadoop/hive/common/type/CalendarUtils.java