Here you can find the source of parseDate(String currDate)
public static Date parseDate(String currDate)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String currDate, String format) { SimpleDateFormat dtFormatdB = null; try {// w w w .j av a2s . c o m dtFormatdB = new SimpleDateFormat(format); return dtFormatdB.parse(currDate); } catch (Exception e) { dtFormatdB = new SimpleDateFormat("yyyy-MM-dd"); try { return dtFormatdB.parse(currDate); } catch (Exception ex) { } } return null; } public static Date parseDate(String currDate) { SimpleDateFormat dtFormatdB = null; dtFormatdB = new SimpleDateFormat("yyyy-MM-dd"); try { return dtFormatdB.parse(currDate); } catch (Exception e) { try { return dtFormatdB.parse(currDate); } catch (Exception ex) { } } return null; } }