List of utility methods to do Calendar to String
String | toString(Calendar calendar) Default calendar to string conversion. return toString(calendar, DEFAULT_DATE_FORMAT);
|
String | toString(final Calendar calendar, final String format) to String final SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(calendar.getTime()); |
String | toString(GregorianCalendar g1) to String StringBuilder buffer = new StringBuilder(); buffer.append( g1.get(Calendar.YEAR) + "/" + (g1.get(Calendar.MONTH) + 1) + "/" + g1.get(Calendar.DAY_OF_MONTH)); buffer.append(" "); buffer.append(g1.get(Calendar.HOUR_OF_DAY) + ":" + g1.get(Calendar.MINUTE) + ":" + g1.get(Calendar.SECOND) + "." + g1.get(Calendar.MILLISECOND)); return buffer.toString(); |