Java Utililty Methods Date to Year

List of utility methods to do Date to Year

Description

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

Method

IntegergetYear(Date aDate)
get Year
Calendar cal = new GregorianCalendar();
cal.setTime(aDate);
return new Integer(cal.get(Calendar.YEAR));
intgetYear(Date d)
get Year
Calendar c = getCalendar();
c.setTime(d);
return (c.get(Calendar.YEAR));
intgetYear(Date d)
get Year
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(Calendar.YEAR);
intgetYear(Date d)
get Year
if (d == null)
    return 0;
final Calendar c = new GregorianCalendar();
c.setTime(d);
return c.get(Calendar.YEAR);
intgetYear(Date date)
get Year
Calendar calendar = getCalendarFromDate(date);
return calendar.get(Calendar.YEAR);
intgetYear(Date date)
get Year
cal.setTime(date);
return cal.get(Calendar.YEAR);
intgetYear(Date date)
get Year
return getField(date, Calendar.YEAR);
intgetYear(Date date)
get Year
GregorianCalendar cal = getCalender(date, false);
return cal.get(Calendar.YEAR);
intgetYear(Date date)
get Year
Calendar cld = Calendar.getInstance();
cld.setTime(date);
return cld.get(Calendar.YEAR);
intgetYear(Date date)
get Year
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.YEAR);