Here you can find the source of getHour(Calendar cal)
public static int getHour(Calendar cal)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static int getHour(Calendar cal) { int hr = cal.get(Calendar.HOUR); return (hr == 0 ? 12 : hr); }/*from w w w. j ava2 s . c o m*/ }