Here you can find the source of toTime(final Date date)
public static Time toTime(final Date date)
//package com.java2s; //License from project: Apache License import java.sql.Time; import java.util.Calendar; import java.util.Date; public class Main { public static Time toTime(final int hour, final int minute, final int second) { Calendar cal = Calendar.getInstance(); cal.set(1970, 0, 1, hour, minute, second); cal.set(Calendar.MILLISECOND, 0); return new Time(cal.getTime().getTime()); }/*from ww w . j a v a2 s . c o m*/ public static Time toTime(final Date date) { return new Time(date.getTime()); } }