Here you can find the source of parseDate(String strDate)
public static final Date parseDate(String strDate)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final Date parseDate(String strDate) { Date date = null;/*from ww w . j a v a 2s . c o m*/ try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); date = dateFormat.parse(strDate); return date; } catch (Exception pe) { return null; } } /** * @param strDate * @param pattern * @return */ public static final Date parseDate(String strDate, String pattern) { SimpleDateFormat df = null; Date date = null; df = new SimpleDateFormat(pattern); try { date = df.parse(strDate); return date; } catch (Exception pe) { return null; } } }