Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String DATE_FORMAT = "MM-dd-yyyy"; public static Date stringToDate(String dateString) throws ParseException { SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT); return df.parse(dateString); } }