Here you can find the source of String2Date(String dateStr)
public static Date String2Date(String dateStr)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat dateFormate = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); public static Date String2Date(String dateStr) { Date date = null;//from ww w . j ava2 s . c o m try { date = dateFormate.parse(dateStr); } catch (java.text.ParseException e) { e.printStackTrace(); } return date; } }