Replace this:
c1.set(Calendar.HOUR, d1.getHours());
with this:
c1.set(Calendar.HOUR_OF_DAY, d1.getHours());
Calendar.HOUR is strictly for 12 hours.
Replace this:
c1.set(Calendar.HOUR, d1.getHours());
with this:
c1.set(Calendar.HOUR_OF_DAY, d1.getHours());
Calendar.HOUR is strictly for 12 hours.