Here you can find the source of timeString2Date(String time)
public static Date timeString2Date(String time) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class Main { private static final String timeFormat = "hh:mm:ss"; public static Date timeString2Date(String time) throws ParseException { if (time == null) { return null; }/*from www . ja v a2 s. com*/ return new SimpleDateFormat(timeFormat).parse(time); } }