@Override
    public DateTime toDateTime(long t) {
      return new DateTime(t, chronology.getZone());
    }
UDFDateFloor.

Abstract class that converts a timestamp to a timestamp with a given granularity.
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDateFloor.java