protected long getDateField(long days) {
    calendar.setTimeInMillis(DateWritableV2.daysToMillis((int) days));
    return calendar.get(field);
  }
Abstract class to return various fields from a Timestamp or Date.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFTimestampFieldDate.java