@Override
    public String toString() {
      return "PeriodGranularity{" + "period=" + period + ", timeZone=" + chronology.getZone()
              + ", origin=" + (hasOrigin ? origin : "null") + '}';
    }
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