Java tutorial
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String DATE_FORMAT = "MM/dd/yyyy hh:mm:ss"; public static String formatDate(Date aDate) { SimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT); return fmt.format(aDate); } }