Java Utililty Methods Calendar from Date

List of utility methods to do Calendar from Date

Description

The list of methods to do Calendar from Date are organized into topic(s).

Method

CalendarcalendarFromDate(Date date)
calendar From Date
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
CalendarconvertDateToCalendar(Date date)
Creates a Calender instance using the date argument.
Calendar cal = Calendar.getInstance();
cal.setTime(date);
setTimePart(cal);
return cal;
CalendarconvertDateToCalendar(Date date)
convert Date To Calendar
if (date != null) {
    Calendar cal = Calendar.getInstance();
    cal.setTimeZone(TimeZone.getTimeZone("GMT"));
    cal.setTime(date);
    return cal;
} else {
    return null;
CalendarconvertDateToCalendar(Date date)
Converts a Date object into a Calendar object.
if (date == null) {
    return null;
Calendar result = Calendar.getInstance();
result.setTime(date);
return result;
CalendarconvertDateToCalendar(final Date d, boolean lenient)
Convert a Date object into a Calendar object.
Calendar cal = Calendar.getInstance(Locale.US);
cal.setLenient(lenient);
cal.setTime(d);
return cal;
CalendarconvertDateToCalendar(final Date dateToCompare)
Convert Date to Calendar date.
final Calendar calendarDate = Calendar.getInstance();
calendarDate.setTime(dateToCompare);
return calendarDate;
Calendardate2Calendar(Date date)
Converts the specified Date to Calendar using the system default time zone.
return date2Calendar(date, TimeZone.getDefault());
Calendardate2Calendar(Date date)
date Calendar
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
Calendardate2Calendar(Date date)
date Calendar
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
CalendarDate2Calendar(Date inDate)
Converts Date to Calendar
Calendar calendarValue = Calendar.getInstance();
if (inDate != null) {
    calendarValue.setTime(inDate);
    return calendarValue;
return calendarValue;