DateTimeUtil { public static Date today() { return new DateMidnight().toDate(); } private  DateTimeUtil(); static String formatDuration(final long duration, final boolean longFormat, final boolean trimZeros); static Date now(); static Date nowZeroSec(); static Calendar nowCalendar(); static Date today(); static Calendar todayCalendar(); static Date yesterday(); static Calendar yesterdayCalendar(); static Date addTime(final Date date, final int period, final int amount); static Calendar addTimeCalendar(final Calendar calendar, final int period, final int amount); static Calendar date2calendar(final Date date); static Calendar parseDate(final String date, final boolean withTime); static Calendar parseDate(final String date, final String pattern); static Calendar parseISODateTime(final String dateTime); static Calendar parseDefaultISODateTime(final String dateTime); static String formatDate(final Date date, final boolean withTime); static String formatDate(final Date date, final String pattern); static String formatDateByLocale(final Date date, Locale locale, int style); static String formatDateTimeByLocale(final Date date, Locale locale, int style); static int extractYear(final Date date); static int getFirstDayOfWeek(Locale locale); static boolean inPast(Date time); static Date getMidnight(Date time); static final String PATTERN_CZ_DATE; static final String PATTERN_CZ_DATETIME; static final String PATTERN_CZ_TIME; static final String PATTERN_LOG; }
@Test public void testToday() { assertNotNull(DateTimeUtil.today()); assertTrue(DateTimeUtil.today().getClass().equals(Date.class)); assertEquals(new DateTime().withTimeAtStartOfDay().toDate(), DateTimeUtil.today()); }