Here you can find the source of year()
public static String year()
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static String year() { Calendar cal = Calendar.getInstance(); return String.valueOf(cal.get(Calendar.YEAR)); }/*from w w w .ja v a2 s . c o m*/ }