Java Calendar from Date getCalendar(Date date)

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

Description

get Calendar

License

Open Source License

Declaration

public static Calendar getCalendar(Date date) 

Method Source Code


//package com.java2s;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static Calendar getCalendar(Date date) {
        Calendar calendar = GregorianCalendar.getInstance();
        if (date == null) {
            calendar.setTime(new Date());
        } else {/*ww w  .ja  v  a2  s. c o m*/
            calendar.setTime(date);
        }
        return calendar;
    }
}

Related

  1. dateToCalendar(Date date)
  2. dateToCalendar(int year, int month, int day)
  3. dateToCalendar(java.util.Date date)
  4. DateToCalendar(java.util.Date date)
  5. dateToCalendar(String date)
  6. getCalendar(Date date)
  7. getCalendar(Date date)
  8. getCalendar(Date date, int firstDayOfWeek)
  9. getCalendar(Date date, int step)