Here you can find the source of string2Date(String time)
public static Date string2Date(String time)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date string2Date(String time) { DateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhssmm"); Date date = new Date(); try {/* ww w. j av a 2 s .co m*/ date = dateFormat.parse(time); } catch (ParseException e) { e.printStackTrace(); } return date; } }