Here you can find the source of getCurrentYear()
public static int getCurrentYear()
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static int getCurrentYear() { return getYear(new Date()); }//from w ww .ja v a 2s . c om public static int getYear(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar.get(Calendar.YEAR); } }