Here you can find the source of toCalendar(Date date)
public static Calendar toCalendar(Date date)
//package com.java2s; /*!// ww w .j a v a 2 s.c o m * mifmi-commons4j * https://github.com/mifmi/mifmi-commons4j * * Copyright (c) 2015 mifmi.org and other contributors * Released under the MIT license * https://opensource.org/licenses/MIT */ import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { public static Calendar toCalendar(Date date) { return toCalendar(date, null, null); } public static Calendar toCalendar(Date date, TimeZone timeZone, Locale locale) { if (date == null) { return null; } return toCalendar(date.getTime(), timeZone, locale); } public static Calendar toCalendar(long date) { return toCalendar(date, null, null); } public static Calendar toCalendar(long date, TimeZone timeZone, Locale locale) { Calendar cal = getCalendar(timeZone, locale); cal.setTimeInMillis(date); return cal; } public static Calendar getCalendar(TimeZone timeZone, Locale locale) { Calendar cal; if (timeZone == null) { if (locale == null) { cal = Calendar.getInstance(); } else { cal = Calendar.getInstance(locale); } } else { if (locale == null) { cal = Calendar.getInstance(timeZone); } else { cal = Calendar.getInstance(timeZone, locale); } } return cal; } }