Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date convertStringToDate(String date) { Date result = null; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { result = format.parse(date); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } }