Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); public static Date convertToDate(String dateStr) { Date date = null; try { date = formatter.parse(dateStr); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return date; } }