Java Calendar Day newCalendarForDay(Date date)

Here you can find the source of newCalendarForDay(Date date)

Description

new Calendar For Day

License

Open Source License

Declaration

public static Calendar newCalendarForDay(Date date) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Calendar newCalendarForDay(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);/*from w  w  w .j av  a  2  s.  c o m*/
        cal.set(Calendar.HOUR, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);

        return cal;
    }
}

Related

  1. isWithinDaysFuture(Calendar cal, int days)
  2. julianDay(Calendar calendar)
  3. minOfDay(Calendar calendar)
  4. moveToCalendarDay(Calendar cal, int day)
  5. moveToCalendarDayJust(Calendar cal)
  6. resetToBeginningOfDay(Calendar c)
  7. sameDay(Calendar a, Calendar b)
  8. sameDay(Calendar c1, Calendar c2)
  9. sameDay(Calendar one, Calendar two)