Here you can find the source of parseDate(String dateValue, String strFormat)
public static Date parseDate(String dateValue, String strFormat)
//package com.java2s; /**//from w ww . j av a2 s . c o m * Core-level framework class: String and Date basic utility methods. * <br><br> * Encapsulates utility methods for everyday programming tasks * with Strings, Dates and other common stuff. * <br> * Creation date: 18/09/2003<br> * Last Update: 18/09/2003<br> * (c) 2003 Martin Cordova<br> * This code is released under the LGPL license<br> * @author Martin Cordova (some code written by Carlos Pineda) */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String dateValue, String strFormat) { if (dateValue == null) return null; if (strFormat == null) strFormat = "yyyy-MM-dd"; SimpleDateFormat dateFormat = new SimpleDateFormat(strFormat); Date newDate = null; try { newDate = dateFormat.parse(dateValue); } catch (ParseException pe) { newDate = null; } return newDate; } }