Here you can find the source of getSQLTime(String timeString)
public static Time getSQLTime(String timeString)
//package com.java2s; //License from project: Apache License import java.sql.Time; import java.util.Calendar; public class Main { /**/*w ww . j a v a 2s . c om*/ * transform date from format like "HH:MM" to sql date * @param @param timeString: * @throws */ public static Time getSQLTime(String timeString) { String[] timeStrings = timeString.split(":"); int hour = Integer.parseInt(timeStrings[0]); int minute = Integer.parseInt(timeStrings[1]); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); Time time = new Time(calendar.getTimeInMillis()); return time; } }