Here you can find the source of strToDate(String stringDate)
public static Timestamp strToDate(String stringDate) throws ParseException
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static Timestamp strToDate(String stringDate) throws ParseException { SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd'T'hh:mm:ss"); //2015-07-03T12:52:29.000Z if (stringDate != null) { java.util.Date dateResult = formatter.parse(stringDate); return new Timestamp(dateResult.getTime()); }/*from ww w . j a v a2 s.com*/ return null; } }