Here you can find the source of parseDateFrom(String dateStr)
public static Date parseDateFrom(String dateStr)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDateFrom(String dateStr) { if (null == dateStr) { return new Date(); }//from w w w.j a v a 2s . c o m SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date value = null; try { value = sdf.parse(dateStr); } catch (ParseException ex) { } return value; } }