Format a date

Stringformat(Date date)Formats a Date into a date/time string.
StringBufferformat(Object obj, StringBuffer toAppendTo, FieldPosition fieldPosition)Overrides Format.

import java.text.DateFormat;
import java.util.Date;

public class Main{
  public static void main(String args[]) {
    DateFormat df = DateFormat.getDateInstance();
    System.out.println(df.format(new Date()));

The output:

18-Nov-2010  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.