Here you can find the source of StringToDate(String data)
public static Date StringToDate(String data)
//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 Date StringToDate(String data) { if (data == null || data.equals("")) { return null; }//from w w w .ja v a2 s. c o m Date date = null; try { DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm"); date = (java.util.Date) formatter.parse(data); } catch (ParseException e) { } return date; } }