Here you can find the source of getHour(Calendar c)
public static int getHour(Calendar c)
//package com.java2s; import java.util.Calendar; public class Main { public static int getHour(Calendar c) { if (c != null) { return c.get(Calendar.HOUR); } else {// ww w.j av a2 s. co m return Calendar.getInstance().get(Calendar.HOUR); } } }