@Test public void testDateToStringWithFormatNoTimeOk() throws Exception { Date date = getCalendar(2013, Calendar.SEPTEMBER, 29, 18, 46, 19); String expectedDate = DateUtils.dateToStringWithFormat(date, DateFormatConstants.DATE_FORMAT_NO_TIME); assertEquals("2013-09-29", expectedDate); }
public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } }
DateUtils { public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } } }
DateUtils { public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } } private  DateUtils(); }
DateUtils { public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } } private  DateUtils(); static Date stringToDateWithFormat(String stringToConvert, String dateFormat); static String dateToStringWithFormat(Date dateToString, String dateFormat); }
DateUtils { public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } } private  DateUtils(); static Date stringToDateWithFormat(String stringToConvert, String dateFormat); static String dateToStringWithFormat(Date dateToString, String dateFormat);  }