Java Calendar from Date dateToCalendar(Date date)

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

Description

Convert the given Date object to a Calendar instance.

License

Open Source License

Parameter

Parameter Description
date The Date object.

Return

The Calendar instance.

Declaration

private static Calendar dateToCalendar(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 {
    /**//  w ww  .ja va  2  s.  co m
     * Convert the given Date object to a Calendar instance.
     *
     * @param date
     *            The Date object.
     * @return The Calendar instance.
     */
    private static Calendar dateToCalendar(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal;
    }
}

Related

  1. date2Calendar(Date date)
  2. date2Calendar(Date date)
  3. Date2Calendar(Date inDate)
  4. dateToCalendar(Date d)
  5. dateToCalendar(Date d)
  6. dateToCalendar(Date date)
  7. dateToCalendar(Date date)
  8. dateToCalendar(int year, int month, int day)
  9. dateToCalendar(java.util.Date date)