List of utility methods to do Calendar Format
String | getCurrentDateString(String dateFormat) get Current Date String Calendar cal = Calendar.getInstance(TimeZone.getDefault()); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(cal.getTime()); |
String | getAsString(Calendar date) get As String return df.format(date.getTime());
|
String | formatCalendar(Calendar calendar) format Calendar return formatCalendar(calendar, DEFAULTFORMAT);
|
String | formatCalendar(Calendar calendar, String pattern) format Calendar SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(calendar.getTime()); |
String | formatDateTime(Calendar dateTime) format Date Time final SimpleDateFormat sDateFormat = new SimpleDateFormat( "MMM d yyyy, HH:mm aaa"); return sDateFormat.format(dateTime.getTime()); |
String | getLongFriendlyDate(Calendar cal) get Long Friendly Date return getLongFriendlyDate(cal.getTime());
|
String | getSelectedDate(Calendar calendar, String pattern) get Selected Date if (TextUtils.isEmpty(pattern)) { pattern = NORMAL_PATTERN; SimpleDateFormat formatter = new SimpleDateFormat(pattern); Date curDate = calendar.getTime(); String str = formatter.format(curDate); return str; |
String | getShortFriendlyDate(Calendar cal) get Short Friendly Date return getShortFriendlyDate(cal.getTime());
|