calendar class in java code example
Example 1: java calendar class format
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println(dateFormat.format(date)); //2013/10/15 16:16:39
Example 2: java Calender examokes
// Get curremt time and date.
Calendar calendar = Calendar.getInstance();
System.out.println("The current date is : " + calendar.getTime());