code: public static long timestampFloor(TimeUnitRange range, long ts, TimeZone tz) {
  		// assume that we are at UTC timezone, just for algorithm performance
  		long offset = tz.getOffset(ts);
  		long utcTs = ts + offset;
  
  		switch (range) {
  			case HOUR:
  				return floor(utcTs, MILLIS_PER_HOUR) - offset;
  			case DAY:
  				return floor(utcTs, MILLIS_PER_DAY) - offset;
  			case MONTH:
  			case YEAR:
  			case QUARTER:
  				int days = (int) (utcTs / MILLIS_PER_DAY + EPOCH_JULIAN);
  				return julianDateFloor(range, days, true) * MILLIS_PER_DAY - offset;
  			default:
  				// for MINUTE and SECONDS etc...,
  				// it is more effective to use arithmetic Method
  				throw new AssertionError(range);
  		}
  	}
docs: --------------------------------------------------------------------------------------------