Here you can find the source of getYear()
public static String getYear()
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { private static Calendar calendar = Calendar.getInstance(); public static String getYear() { return calendar.get(Calendar.YEAR) + ""; }//ww w .j a v a2s .c om }