/** * Appends to <code>sbuf</code> the date in the format "dd MMM YYYY * HH:mm:ss,SSS" for example, "06 Nov 1994 08:49:37,459". * * @param sbuf the string buffer to write to */ public StringBuffer format(Date date, StringBuffer sbuf, FieldPosition fieldPosition) { calendar.setTime(date); int day = calendar.get(Calendar.DAY_OF_MONTH); if (day < 10) sbuf.append('0'); sbuf.append(day); sbuf.append(' '); sbuf.append(shortMonths[calendar.get(Calendar.MONTH)]); sbuf.append(' '); int year = calendar.get(Calendar.YEAR); sbuf.append(year); sbuf.append(' '); return super.format(date, sbuf, fieldPosition); }
/** * Appends to <code>sbuf</code> the date in the format "dd MMM YYYY * HH:mm:ss,SSS" for example, "06 Nov 1994 08:49:37,459". * * @param sbuf the string buffer to write to */ public StringBuffer format(Date date, StringBuffer sbuf, FieldPosition fieldPosition) { calendar.setTime(date); int day = calendar.get(Calendar.DAY_OF_MONTH); if (day < 10) sbuf.append('0'); sbuf.append(day); sbuf.append(' '); sbuf.append(shortMonths[calendar.get(Calendar.MONTH)]); sbuf.append(' '); int year = calendar.get(Calendar.YEAR); sbuf.append(year); sbuf.append(' '); return super.format(date, sbuf, fieldPosition); }