Here you can find the source of stringToDate(String date)
public static Date stringToDate(String date)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date stringToDate(String date) { Integer day = Integer.valueOf(date.split("/")[0]); String corectedDate = String.valueOf(day + 1) + "/" + date.split("/")[1] + "/" + date.split("/")[2]; SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy"); Date fechaDate = null;//from ww w. ja va2 s. c o m try { fechaDate = formato.parse(corectedDate); } catch (ParseException ex) { } return fechaDate; } }