Here you can find the source of getCalTime(Time startTime, Calendar cal)
public static void getCalTime(Time startTime, Calendar cal)
//package com.java2s; import java.sql.Time; import java.util.*; public class Main { public static void getCalTime(Time startTime, Calendar cal) { int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); cal.setTime(startTime);//w ww. ja v a 2s . c om int hour = cal.get(Calendar.HOUR_OF_DAY); int min = cal.get(Calendar.MINUTE); int sec = cal.get(Calendar.SECOND); cal.set(year, month, day, hour, min, sec); } }