Here you can find the source of convertToDate(String date)
public final static Date convertToDate(String date) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static Date convertToDate(String date) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); if (date != null && !date.isEmpty()) { return sdf.parse(date); }//from w w w . j a v a 2s. co m return null; } }