@Test public void floorToMonth() throws Exception { DateTime dt0 = new DateTime(2009,6,24,23,30,30,789,DateTimeZone.forID("America/Los_Angeles")); DateTime dt1 = DateTimeUtil.floorToMonth(dt0); Assert.assertEquals(2009, dt1.getYear()); Assert.assertEquals(6, dt1.getMonthOfYear()); Assert.assertEquals(1, dt1.getDayOfMonth()); Assert.assertEquals(0, dt1.getHourOfDay()); Assert.assertEquals(0, dt1.getMinuteOfHour()); Assert.assertEquals(0, dt1.getSecondOfMinute()); Assert.assertEquals(0, dt1.getMillisOfSecond()); Assert.assertEquals(DateTimeZone.forID("America/Los_Angeles"), dt1.getZone()); DateTime dt2 = DateTimeUtil.floorToMonth(null); Assert.assertNull(dt2); }
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()); }
DateTimeUtil { 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()); } }
DateTimeUtil { 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()); }  }
DateTimeUtil { 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()); }  static DateTime toDateTime(Timestamp value); static DateTime copy(DateTime value); static Timestamp toTimestamp(DateTime dt); static DateTime now(); static DateTime parseEmbedded(String string0); static DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone); static DateTime floorToYear(DateTime value); static DateTime floorToMonth(DateTime value); static DateTime floorToDay(DateTime value); static DateTime floorToHour(DateTime value); static DateTime floorToHalfHour(DateTime value); static DateTime floorToQuarterHour(DateTime value); static DateTime floorToTenMinutes(DateTime value); static DateTime floorToFiveMinutes(DateTime value); static DateTime floorToMinutePeriod(DateTime value, int periodInMinutes); static DateTime floorToMinute(DateTime value); static DateTime floorToSecond(DateTime value); }
DateTimeUtil { 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()); }  static DateTime toDateTime(Timestamp value); static DateTime copy(DateTime value); static Timestamp toTimestamp(DateTime dt); static DateTime now(); static DateTime parseEmbedded(String string0); static DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone); static DateTime floorToYear(DateTime value); static DateTime floorToMonth(DateTime value); static DateTime floorToDay(DateTime value); static DateTime floorToHour(DateTime value); static DateTime floorToHalfHour(DateTime value); static DateTime floorToQuarterHour(DateTime value); static DateTime floorToTenMinutes(DateTime value); static DateTime floorToFiveMinutes(DateTime value); static DateTime floorToMinutePeriod(DateTime value, int periodInMinutes); static DateTime floorToMinute(DateTime value); static DateTime floorToSecond(DateTime value);  }