/** * Formats the given date with the given format. * * @param pDate the date * @param pFormat the format * @param pLocale the locale * @return the string */ private String format(Date pDate, String pFormat, Locale pLocale) { SimpleDateFormat formatter = (pLocale == null) ? new SimpleDateFormat(pFormat) : new SimpleDateFormat(pFormat, pLocale); Calendar cal = Calendar.getInstance(); StringBuffer result = new StringBuffer(20); return formatter.format(cal, result, null).toString(); }