code: public static DateTime floorToDay(DateTime value) {
          if (value == null) {
              return null;
          }
          return new DateTime(value.getYear(), value.getMonthOfYear(), value.getDayOfMonth(), 0, 0, 0, 0, value.getZone());
      }
docs: Null-safe method that returns a new instance of a DateTime object rounded
  downwards to the nearest day. The time zone of the returned DateTime
  instance will be the same as the argument. Similar to a floor() function
  on a float.<br>
  Examples:
  <ul>
  <li>null -> null
  <li>"2009-06-24 13:24:51.476 -8:00" -> "2009-06-24 00:00:00.000 -8:00"
  </ul>
  @param value The DateTime value to round downward
  @return Null if the argument is null or a new instance of the DateTime
  value rounded downwards to the nearest day.