code: public static DateTime floorToMonth(DateTime value) {
          if (value == null) {
              return null;
          }
          return new DateTime(value.getYear(), value.getMonthOfYear(), 1, 0, 0, 0, 0, value.getZone());
      }
docs: Null-safe method that returns a new instance of a DateTime object rounded
  downwards to the nearest month. Note that the nearest valid month is actually
  the first of that given month (1st day of month). 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-01 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 month.