Here you can find the source of parseDate(String date)
public static Date parseDate(String date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String date) { DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd"); Date myDate2 = null;//from ww w . java 2 s . c om try { myDate2 = dateFormat2.parse(date); } catch (ParseException e) { // e.printStackTrace(); return null; } return myDate2; } }