Here you can find the source of getDateFromStr(String date)
public static Date getDateFromStr(String date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getDateFromStr(String date) { Date result = null;/*from w w w. j a v a2 s .c om*/ try { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); sdf.setLenient(false); result = sdf.parse(date); } catch (Exception e) { System.out.println("Error: " + e.toString()); } return result; } }