Here you can find the source of convertToDate(String dateString)
public static String convertToDate(String dateString)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String convertToDate(String dateString) { SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMMM-yy"); Date convertedDate = new Date(); try {/*from w ww.ja v a 2 s. c o m*/ convertedDate = dateFormat.parse(dateString); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return convertedDate.toLocaleString(); } }