Here you can find the source of copyCalendarDay(final Calendar src, final Calendar dest)
private static void copyCalendarDay(final Calendar src, final Calendar dest)
//package com.java2s; // ProjectForge is dual-licensed. import java.util.Calendar; public class Main { private static void copyCalendarDay(final Calendar src, final Calendar dest) { copyCalField(src, dest, Calendar.YEAR); copyCalField(src, dest, Calendar.MONTH); copyCalField(src, dest, Calendar.DAY_OF_MONTH); dest.set(Calendar.HOUR_OF_DAY, 0); dest.set(Calendar.MINUTE, 0); dest.set(Calendar.SECOND, 0); dest.set(Calendar.MILLISECOND, 0); }/*from ww w.ja v a 2 s . c o m*/ private static void copyCalField(final Calendar src, final Calendar dest, final int field) { dest.set(field, src.get(field)); } }