@Override
    public int hashCode() {
      int result = period.hashCode();
      result = 31 * result + chronology.hashCode();
      result = 31 * result + (int) (origin ^ (origin >>> 32));
      result = 31 * result + (hasOrigin ? 1 : 0);
      return result;
    }
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