Here you can find the source of getCurrentYear()
public static int getCurrentYear()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { /**//from w w w .j ava2 s .c o m * @return currentYear indicates the the actual year */ public static int getCurrentYear() { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); return cal.get(Calendar.YEAR); } }