Here you can find the source of changeStringToDate(String fecha, String pattern)
public static Date changeStringToDate(String fecha, String pattern) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date changeStringToDate(String fecha, String pattern) throws ParseException { DateFormat formato = new SimpleDateFormat(pattern); return formato.parse(fecha); }/*from w w w .j a v a 2 s .co m*/ }