如何将日期转换为字符串MM/dd/yyyy格式?

Raj*_*esh -1 java date simpledateformat date-formatting

我有一个日期2014-10-01 00:00:00.0我必须转换成10/01.2014我怎么样?

Moh*_*din 6

这个怎么样

try
 {
    String currentDate = "2014-10-01 00:00:00.0";
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
    Date tempDate=simpleDateFormat.parse(currentDate);
    SimpleDateFormat outputDateFormat = new SimpleDateFormat("dd/MM.YYYY");           
    System.out.println("Output date is = "+outputDateFormat.format(tempDate));
  } catch (ParseException ex) 
  {
        System.out.println("Parse Exception");
  }
Run Code Online (Sandbox Code Playgroud)