Java Calendar Day copyCalendarDay(final Calendar src, final Calendar dest)

Here you can find the source of copyCalendarDay(final Calendar src, final Calendar dest)

Description

copy Calendar Day

License

Open Source License

Declaration

private static void copyCalendarDay(final Calendar src, final Calendar dest) 

Method Source Code

//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));
    }
}

Related

  1. calendarAtStartOfToday()
  2. calendarDayToOrdinalDay(int dow)
  3. calToBeginningOfDay(Calendar c)
  4. ceilAllLessThanDay(Calendar cal)
  5. convertEndOfDay(Calendar cal)
  6. createBeginningOfDay(Calendar calendar)
  7. date2day(Calendar cal)
  8. day(Calendar calendar)
  9. day(Calendar date)