Java tutorial
import java.util.Calendar; public class MainClass { public static void main(String args[]) { Calendar dateTime = Calendar.getInstance(); System.out.printf("%tc\n", dateTime); System.out.printf("%tF\n", dateTime); System.out.printf("%tD\n", dateTime); System.out.printf("%tr\n", dateTime); System.out.printf("%tT\n", dateTime); } }