public static String formatDate(long epochDay, boolean useProleptic) {
    long millis = TimeUnit.DAYS.toMillis(epochDay);
    return useProleptic ? PROLEPTIC_DATE_FORMAT.get().format(millis)
        : HYBRID_DATE_FORMAT.get().format(millis);
  }
Formats epoch day to date according to proleptic or hybrid calendar

@param epochDay  epoch day
@param useProleptic if true - uses proleptic formatter, else uses hybrid formatter
@return formatted date
storage-api/src/java/org/apache/hadoop/hive/common/type/CalendarUtils.java