Here you can find the source of currentYear()
public static Integer currentYear()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private final static SimpleDateFormat yyyy = new SimpleDateFormat( "yyyy"); public static Integer currentYear() { return Integer.parseInt(yyyy.format(new Date())); }/*from w w w . j ava 2 s . c o m*/ }