Here you can find the source of createCalendar()
public static GregorianCalendar createCalendar()
//package com.java2s; //License from project: Apache License import static java.util.Calendar.HOUR_OF_DAY; import static java.util.Calendar.MILLISECOND; import static java.util.Calendar.MINUTE; import static java.util.Calendar.SECOND; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**/* ww w . j av a2 s. c om*/ * This method creates and returns a new calendar. * * @return A new calendar. */ public static GregorianCalendar createCalendar() { return createCalendar(null); } /** * This method creates and returns a new calendar. * * @param date The date to initialize the calendar to. * * @return A new calendar. */ public static GregorianCalendar createCalendar(Date date) { GregorianCalendar calendar = new GregorianCalendar(); if (date == null) { date = new Date(); } calendar.setTime(date); clearClockFor(calendar); return calendar; } /** * This method sets the clock to 00:00:00:000. * * @param calendar The calendar to clear the clock for. */ public static void clearClockFor(Calendar calendar) { // Set time to 00:00:00:000 calendar.set(HOUR_OF_DAY, 0); calendar.set(MILLISECOND, 0); calendar.set(MINUTE, 0); calendar.set(SECOND, 0); } }