Here you can find the source of parseSimpleDate(String string, Date defaultDate)
public static Date parseSimpleDate(String string, Date defaultDate)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static final SimpleDateFormat SIMPLE_DAY_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static Date parseSimpleDate(String string, Date defaultDate) { if (string == null) { return defaultDate; }// w w w .j a va2s . c om try { return SIMPLE_DAY_FORMAT.parse(string); } catch (ParseException e) { return defaultDate; } } public static Date parse(String pattern, String dateStr) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(pattern); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.parse(dateStr); } }