Here you can find the source of parseDate(String date)
public static Date parseDate(String date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String common_pattern = "yyyy-MM-dd HH:mm:ss"; public static Date parseDate(String date) { SimpleDateFormat format = new SimpleDateFormat(common_pattern); try {//from ww w . j ava 2s . c o m return format.parse(date); } catch (Exception e) { e.printStackTrace(); } return null; } }