Here you can find the source of stringToDateForIng(String date_str)
public static Date stringToDateForIng(String date_str) throws Exception
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static String datePatternForIng = "dd-MM-yyyy"; public static Date stringToDateForIng(String date_str) throws Exception { SimpleDateFormat format = new SimpleDateFormat(datePatternForIng); try {/*from w w w . ja v a 2s . co m*/ return format.parse(date_str); } catch (ParseException e) { throw new Exception("errors.date.invalid"); } } }