Here you can find the source of mergeDateTime(Date date, Time time)
public static Calendar mergeDateTime(Date date, Time time)
//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 Calendar mergeDateTime(Date date, Time time) { Calendar cal = Calendar.getInstance(); if (date != null) { cal.setTime(date);/* w w w . ja v a2 s . c o m*/ } if (time != null) { Calendar temp = Calendar.getInstance(); temp.setTime(time); cal.set(11, temp.get(11)); cal.set(12, temp.get(12)); cal.set(13, temp.get(13)); cal.set(14, temp.get(14)); } return cal; } }