Java tutorial
import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); // print current year System.out.println("Current year is :" + cal.get(Calendar.YEAR)); // set the year to something else cal.set(Calendar.YEAR, 2013); // print the result System.out.println("Altered year is :" + cal.get(Calendar.YEAR)); } }