Java Utililty Methods Year Current

List of utility methods to do Year Current

Description

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

Method

intcurrentDayForYear(long selectTime)
current Day For Year
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(selectTime);
return calendar.get(Calendar.DAY_OF_YEAR);
intcurrentYear()
current Year
return Calendar.getInstance().get(Calendar.YEAR);
intcurrentYear()
Returns the current time of the system
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
return year;
intcurrentYear()
current Year
java.util.Calendar c = java.util.Calendar.getInstance();
return c.get(java.util.Calendar.YEAR);
intgetCurMonthDayNumber(String strYear, String strMonth)
get Cur Month Day Number
int ret = -1;
if ((Integer.parseInt(strMonth) > 0) && (Integer.parseInt(strMonth) <= 12)) {
    Calendar cal = Calendar.getInstance(Locale.CHINA);
    cal.clear();
    cal.set(new Integer(strYear).intValue(), new Integer(strMonth).intValue() - 1, 1);
    ret = cal.getActualMaximum(5);
return ret;
...
intgetCurrentYear()
get Current Year
Calendar cal = GregorianCalendar.getInstance();
cal.setTime(new Date());
int year = cal.get(Calendar.YEAR);
return year;
intgetCurrentYear()
Returns the current calendar year
return getYear(new Date());
StringgetCurrentYear()
get Current Year
int year = Calendar.getInstance().get(Calendar.YEAR);
String currentYear = String.valueOf(year);
return currentYear;
intgetCurrentYear()
get Current Year
return getYear(new Date());
intgetCurrentYear()
Returns the current year.
return getCalendar().get(Calendar.YEAR);