code: public static long midnightUTC(long epochMillis) {
      Calendar day = Calendar.getInstance(UTC);
      day.setTimeInMillis(epochMillis);
      day.set(Calendar.MILLISECOND, 0);
      day.set(Calendar.SECOND, 0);
      day.set(Calendar.MINUTE, 0);
      day.set(Calendar.HOUR_OF_DAY, 0);
      return day.getTimeInMillis();
    }
docs: For bucketed data floored to the day. For example, dependency links.