Here you can find the source of currentYear()
public static String currentYear()
//package com.java2s; //License from project: LGPL import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat formatter; public static String currentYear() { formatter = new SimpleDateFormat("yyyy"); return formatter.format(new Date()); }// w w w . j ava 2 s . c om }