public Date readDate() throws IOException, ParseException {
    int di = readInt();
    if (di == 0) {
      return null;
    }
    String dateString = String.valueOf(di + 19000000);
    if (dateString.length() < DATE_STRING_LENGTH) {
      dateString = StringUtils.leftPad(dateString, DATE_STRING_LENGTH, '0');
    }
    Date date = new Date();
    date.setYear(Integer.parseInt(dateString.substring(0, 4)));
    date.setMonth(Integer.parseInt(dateString.substring(4, 6)));
    date.setDayOfMonth(Integer.parseInt(dateString.substring(6, 8)));
    return date;
  }
Read DATE.
The representation of date in Teradata binary format is:
The Date D is a int with 4 bytes using little endian,
The representation is (D+19000000).ToString -&gt; YYYYMMDD,
eg: Date 07 b2 01 00 -&gt; 111111 in little endian -&gt; 19111111 - &gt; 1911.11.11.
the null date will use 0 to pad.

@return the date
@throws IOException the io exception
@throws ParseException the parse exception
serde/src/java/org/apache/hadoop/hive/serde2/teradata/TeradataBinaryDataInputStream.java