Here you can find the source of getSqlTimeFromTimeNumber(int time)
public static Time getSqlTimeFromTimeNumber(int time)
//package com.java2s; import java.sql.Time; import java.util.Calendar; public class Main { public static Time getSqlTimeFromTimeNumber(int time) { int leftover = time; final int hour = leftover / (60 * 60 * 1000); leftover -= hour * 60 * 60 * 1000; final int minute = leftover / (60 * 1000); leftover -= minute * 60 * 1000;/*from w w w . jav a 2 s . c o m*/ final int second = leftover / 1000; leftover -= second * 1000; final int milli = leftover; Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); calendar.set(Calendar.MILLISECOND, milli); return new Time(calendar.getTimeInMillis()); } }