Java tutorial
import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); // print current time System.out.println("Current year is :" + cal.getTime()); // set the year,month and day to something else cal.set(2013, 5, 25, 04, 15, 20); System.out.println("Altered year is :" + cal.getTime()); } }