import java.util. * ; import java.text. * ; class Test ... { public static void main(String[] args) throws Exception ...{ String s = "Tue, 26 Sep 2006 04:43:11 GMT"; //String s = "26 Sep 2006"; DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH); //DateFormat format = new SimpleDateFormat("d MMM yyyy", Locale.ENGLISH); //DateFormat format = DateFormat.getDateInstance(DateFormat.FULL, Locale.ENGLISH); Date d = format.parse(s); System.out.println(d); System.out.println(DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ENGLISH).format(d)); System.out.println(DateFormat.getDateInstance(DateFormat.FULL, Locale.ENGLISH).format(d)); System.out.println(DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.ENGLISH).format(d)); System.out.println(DateFormat.getDateInstance(DateFormat.LONG, Locale.ENGLISH).format(d)); System.out.println(DateFormat.getDateInstance(DateFormat.SHORT, Locale.ENGLISH).format(d)); System.out.println(percent(13.0, 100.0)); } public static String percent( double p1, double p2) ...{ String str; double p3 = p1 / p2; NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMinimumFractionDigits( 2 ); str = nf.format(p3); return str; } }