Here you can find the source of parseDate(String date)
public static Date parseDate(String date)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class Main { private static final Lock LOCK = new ReentrantLock(); public static Date parseDate(String date) { return parseDate(date, "yyyy-MM-dd"); }/* w w w.j a va 2s.c o m*/ public static Date parseDate(String date, String pattern) { LOCK.lock(); try { DateFormat fmt = new SimpleDateFormat(pattern); return fmt.parse(date); } catch (ParseException e) { e.printStackTrace(); return null; } finally { LOCK.unlock(); } } }