Here you can find the source of date2Calendar(Date date)
public static Calendar date2Calendar(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Calendar date2Calendar(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*w ww . j a v a2 s. c om*/ return cal; } private static Calendar setTime(final Calendar calendat, final String[] test) { if (test.length == 3) { calendat.set(Calendar.HOUR_OF_DAY, Integer.parseInt(test[0].trim())); calendat.set(Calendar.MINUTE, Integer.parseInt(test[1].trim())); calendat.set(Calendar.SECOND, Integer.parseInt(test[2].trim())); } if (test.length == 2) { calendat.set(Calendar.HOUR_OF_DAY, Integer.parseInt(test[0].trim())); calendat.set(Calendar.MINUTE, Integer.parseInt(test[1].trim())); calendat.set(Calendar.SECOND, 0); } return calendat; } }