Here you can find the source of formatDate(String inputDate)
public static String formatDate(String inputDate) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String inputDateFormat = "yyyy-MM-dd"; private static final String outputDateFormat = "dd/MM/yyyy"; public static String formatDate(String inputDate) throws ParseException { // formatting date in Java using SimpleDateFormat SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(inputDateFormat); Date d = DATE_FORMAT.parse(inputDate); DATE_FORMAT.applyPattern(outputDateFormat); return DATE_FORMAT.format(d); }//from w ww . j a v a 2 s. c o m }