List of utility methods to do Date to Calendar Convert
Calendar | Date2Calendar(Date d) Date Calendar Calendar c = Calendar.getInstance();
c.setTime(d);
return c;
|
Calendar | getCalendar(Date date) get Calendar Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
|
GregorianCalendar | getCalendar(Date day) get Calendar GregorianCalendar gregorianCalendar = new GregorianCalendar(); gregorianCalendar.setTime(day); return gregorianCalendar; |
Calendar | toCalendar(Date date) Convert a Date into a Calendar . Calendar c = Calendar.getInstance();
c.setTime(date);
return c;
|
Calendar | getCalendar(Date date) get Calendar if (date == null) return null; Calendar c = new GregorianCalendar(); c.setTime(date); return c; |
Calendar | getCalendarFromDate(Date date) Get Calendar instance based on given Date object. if (StringUtils.isNull(date)) { throw new NullPointerException("date cannot be null"); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; |
Calendar | calendarFromDate(Date d) calendar From Date Calendar c = Calendar.getInstance();
c.setTime(d);
return c;
|
Calendar | calendarDate(Date date) calendar Date Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
|
Calendar | convert(Date date) convert Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar; |
int | getCalendarField(Date date, int field) get Calendar Field Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.get(field);
|