Here you can find the source of parseDate(String dateStr, String format)
public static Date parseDate(String dateStr, String format)
//package com.java2s; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String dateStr, String format) { if (dateStr == null) return null; SimpleDateFormat formatter = new SimpleDateFormat(format); ParsePosition ps = new ParsePosition(0); Date date = formatter.parse(dateStr, ps); return date; }//from www.j ava 2 s . co m }