code: public static Date floor(Date d) {
          Calendar c = Calendar.getInstance();
          c.setTime(d);
          c.set(Calendar.HOUR_OF_DAY, 0);
          c.set(Calendar.MINUTE, 0);
          c.set(Calendar.SECOND, 0);
          c.set(Calendar.MILLISECOND, 0);
          return c.getTime();
      }
docs: Rounds a date to hour 0, minute 0, second 0 and millisecond 0
  @param d the date
  @return the rounded date