List of utility methods to do Calendar Format
String | calToString(Calendar cal) cal To String DateFormat f = SimpleDateFormat.getDateInstance(DateFormat.SHORT);
return f.format(cal.getTime());
|
String | format(Calendar cal) Null-safe method to display a Calendar as a formatted String . return cal == null ? "null" : "<" + df.format(cal.getTime()) + ">"; |
String | format(Calendar cal) Formats a Calendar value into a ISO8601-compliant date/time string.
SimpleDateFormat format = new SimpleDateFormat(ISO_FORMAT); TimeZone tz = cal.getTimeZone(); format.setTimeZone(tz); StringBuffer tzd = new StringBuffer("Z"); int offset = tz.getRawOffset(); if (offset != 0) { int hours = Math.abs((offset / (60 * 1000)) / 60); int minutes = Math.abs((offset / (60 * 1000)) % 60); ... |
String | format(Calendar cal, String format) format if (cal == null) return ""; SimpleDateFormat myFormatter = new SimpleDateFormat(format); return myFormatter.format(cal.getTime()); |
String | format(Calendar cal, String pattern) format SimpleDateFormat formatter = new SimpleDateFormat(pattern); return formatter.format(calendarToDate(cal)); |
String | format(Calendar calendar) format return new SimpleDateFormat("dd-MM-yyyy").format(calendar.getTime()); |
String | format(Calendar calendar) format if (calendar == null) { return null; return dateFormat.format(calendar.getTime()); |
String | format(Calendar calendar) format a calendar using SimpleDateFormat , with default pattern. String formatted = ""; if (calendar != null) { formatted = new SimpleDateFormat().format(calendar.getTime()); return formatted; |
String | format(Calendar calendar) format if (calendar == null) { return null; return DATE_FORMAT.format(calendar.getTime()); |
String | format(Calendar calendar) format return getDateFormat(a).format(calendar.getTime());
|