Converting a Date object to a calendar object [duplicate]
Here’s your method: public static Calendar toCalendar(Date date){ Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal; } Everything else you are doing is both wrong and unnecessary. BTW, Java Naming conventions suggest that method names start with a lower case letter, so it should be: dateToCalendar or toCalendar (as shown). OK, let’s milk your code, shall … Read more