Here you can find the source of currentYear()
public static int currentYear()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { /** Returns the current time of the system */ public static int currentYear() { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); return year; }//from ww w . j a v a2s. c o m }