Here you can find the source of getDateFromRequestStringDate(String dateString)
public static Date getDateFromRequestStringDate(String dateString)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getDateFromRequestStringDate(String dateString) { Date resDate = null;//from w ww . j a v a2 s . c om try { String dateSource = dateString; dateSource = dateSource.trim(); dateSource = dateSource.replaceAll("T", " "); SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); //simpleDateFormat. resDate = simpleDateFormat.parse(dateSource); } catch (ParseException exc) { return null; } return resDate; } }