Here you can find the source of mergeDateAndTime(final Calendar date, final Calendar time)
public static Calendar mergeDateAndTime(final Calendar date, final Calendar time)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static Calendar mergeDateAndTime(final Calendar date, final Calendar time) { time.set(Calendar.YEAR, date.get(Calendar.YEAR)); time.set(Calendar.DAY_OF_MONTH, date.get(Calendar.DAY_OF_MONTH)); time.set(Calendar.MONTH, date.get(Calendar.MONTH)); return time; }//from w ww .j a v a2 s. c o m }