@Test public void createCalendarMidnightTest() { Date date = new Date(1992312312L); Date expected = new Date(1987200000L); Calendar result = DateUtil.createCalendarMidnight(date); assertThat(result.getTime().getTime(), is(expected.getTime())); }
public static Calendar createCalendarMidnight(final Date date) { Calendar cal = new GregorianCalendar(getTimeZone("GMT+0")); cal.setTime(date); cal.set(HOUR_OF_DAY, 0); cal.set(MINUTE, 0); cal.set(SECOND, 0); cal.set(MILLISECOND, 0); return cal; }
DateUtil { public static Calendar createCalendarMidnight(final Date date) { Calendar cal = new GregorianCalendar(getTimeZone("GMT+0")); cal.setTime(date); cal.set(HOUR_OF_DAY, 0); cal.set(MINUTE, 0); cal.set(SECOND, 0); cal.set(MILLISECOND, 0); return cal; } }
DateUtil { public static Calendar createCalendarMidnight(final Date date) { Calendar cal = new GregorianCalendar(getTimeZone("GMT+0")); cal.setTime(date); cal.set(HOUR_OF_DAY, 0); cal.set(MINUTE, 0); cal.set(SECOND, 0); cal.set(MILLISECOND, 0); return cal; } private  DateUtil(); }
DateUtil { public static Calendar createCalendarMidnight(final Date date) { Calendar cal = new GregorianCalendar(getTimeZone("GMT+0")); cal.setTime(date); cal.set(HOUR_OF_DAY, 0); cal.set(MINUTE, 0); cal.set(SECOND, 0); cal.set(MILLISECOND, 0); return cal; } private  DateUtil(); static Date parseISOTimestamp(String timestampStr); static Calendar createCalendarMidnight(final Date date); static String getUTCTime(); }
DateUtil { public static Calendar createCalendarMidnight(final Date date) { Calendar cal = new GregorianCalendar(getTimeZone("GMT+0")); cal.setTime(date); cal.set(HOUR_OF_DAY, 0); cal.set(MINUTE, 0); cal.set(SECOND, 0); cal.set(MILLISECOND, 0); return cal; } private  DateUtil(); static Date parseISOTimestamp(String timestampStr); static Calendar createCalendarMidnight(final Date date); static String getUTCTime();  }