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