Here you can find the source of StringToDate(String fecha)
public static Date StringToDate(String fecha)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date StringToDate(String fecha) { SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy/MM/dd"); Date aux = null;/* w w w . j av a2s .c om*/ try { aux = formatoDelTexto.parse(fecha); } catch (Exception ex) { } return aux; } }