This tip will show the use of Calendar class and print the current date and time on the console.

Java Code:
import java.util.Calendar;

public class CalendarExp {

	public static void main(String[] args) {
		Calendar c = Calendar.getInstance();
		System.out.println("");
		System.out.println("YEAR  : " + c.get(Calendar.YEAR));
		System.out.println("MONTH : " + c.get(Calendar.MONTH));
		System.out.println("DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
		System.out.println("HOUR  : " + c.get(Calendar.HOUR));
		System.out.println("MINUTE: " + c.get(Calendar.MINUTE));
		System.out.println("SECOND: " + c.get(Calendar.SECOND));
	}
}