This will formte the Date to the MM-DD-YYYY format
public static String formatDate(Date date) { //create new calendar instance Calendar cal1 = Calendar.getInstance(); String dob = ""; //check for null if(date==null) //if null create new date instance date = new Date(); cal1.setTime(date); if (cal1 != null) { dob = "" + ((cal1.get(Calendar.MONTH)) + 1); dob += "-" + cal1.get(Calendar.DATE); dob += "-" + cal1.get(Calendar.YEAR); } return dob; }