Here you can find the source of parseDate(String dateStr, String formatStr)
public static java.util.Date parseDate(String dateStr, String formatStr)
//package com.java2s; //License from project: Apache License import java.util.*; import java.text.*; public class Main { public static Date parseDate(java.sql.Date date) { return date; }/*from ww w .j a v a 2s. c om*/ public static java.util.Date parseDate(String dateStr, String formatStr) { SimpleDateFormat format = new SimpleDateFormat(formatStr); try { return format.parse(dateStr); } catch (ParseException e) { e.printStackTrace(); return null; } } }