Output current time: %tc
import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { Calendar cal = Calendar.getInstance(); System.out.printf("Current time and date: %tc\n", cal); } }