Java tutorial
import java.util.Calendar; public class MainClass { public static void main(String args[]) { Calendar dateTime = Calendar.getInstance(); System.out.printf("%1$tH:%1$tM:%1$tS\n", dateTime); System.out.printf("%1$tZ %1$tI:%1$tM:%1$tS", dateTime); } }