Import java.util.date; import java.text.dateFormat; / ** * Format time class * DateFormat.Full = 0 * DateFormat.default = 2 * DateFormat.long = 1 * DateFormat.medium = 2 * DateFormat.short = 3 * @Author Qu Jinson Qujl@neusoft.com * @version 1.0, 2005/04/16 * / public class form (String [] args) {date d = new date (); string S; / ** Date class format: SAT APR 16 13:17:29 CST 2005 * / system.out.println (d); system.out.println ("************* ***************************** "); / * getdateInstance () * / / ** Output format: 2005-4-16 * / S = DateFormat.getdateInstance (). Format (d); system.out.println (s); / ** Output format: 2005-4-16 * / s = DateFormat.getdateInstance (DateFormat.default) .format ( d); system.out.println (s); / ** Output format: Saturday, April 16, 2005 * / s = Dateformat.getdateInstance (DateFormat.Full) .format (d); System.out.Println (S ); / ** Output format: 2005-4 -16 * / s = dateformat.getdateInstance (DateFormat.medium) .format (d); system.out.println (s); / ** Output format: 05-4-16 * / s = DateFormat.getdateInstance (DateFormat. Short) .format (d); system.out.println (s); system.out.println ("*********************** **************** ");}}