List of utility methods to do Calendar to Date
Date | calendarToDate(Calendar c) Returns a java Calendar as a Date. if (c == null) { return null; return new Date(c.getTimeInMillis()); |
Date | calendarToDate(Calendar cal) calendar To Date return cal.getTime();
|
int | calendarToDateId(Calendar cal) Convert a calendar to a date id return cal.get(Calendar.YEAR) * 10000 + (cal.get(Calendar.MONTH) + 1) * 100
+ cal.get(Calendar.DAY_OF_MONTH);
|
java.util.Date | getDate(Calendar cal) Returns the current time from a calendar object java.util.Date convertedDate = null; try { SimpleDateFormat formatter = (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.SHORT); formatter.applyPattern("M/d/yyyy"); String tmpDate = (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.YEAR); convertedDate = formatter.parse(tmpDate); } catch (Exception e) { ... |
Date | toDate(Calendar cal) to Date if (cal != null) { return cal.getTime(); return null; |
Date | toDate(Calendar calendar) Converts a java.util.Calendar to a java.util.Date .
return calendar.getTime();
|
Date | toDate(Calendar calender) to Date return calender.getTime();
|
Date | toDate(Calendar input) Converts the given Calendar object to a Date object. if (input == null) return null; return input.getTime(); |
Date | toDate(final Calendar calendar) Converts a Calendar-object to a Date. final Date date = calendar.getTime(); return date; |