Here you can find the source of strToTime(String strDate)
public static java.sql.Time strToTime(String strDate)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static java.sql.Time strToTime(String strDate) { String str = strDate;/*from w w w .jav a 2 s.co m*/ SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); java.util.Date d = null; try { d = format.parse(str); } catch (Exception e) { e.printStackTrace(); } java.sql.Time time = new java.sql.Time(d.getTime()); return time.valueOf(str); } }