Here you can find the source of getCurrentYear()
public static int getCurrentYear()
//package com.java2s; //License from project: LGPL import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static int getCurrentYear() { Calendar cal = GregorianCalendar.getInstance(); cal.setTime(new Date()); int year = cal.get(Calendar.YEAR); return year; }/*from www .ja va 2s. co m*/ }