All pastes #1973592 Raw Edit

Formats date? :)

public java v1 · immutable
#1973592 ·published 2010-10-26 12:05 UTC
rendered paste body
	/**	 * 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();			}