Here you can find the source of getHour(java.util.Date date)
public static int getHour(java.util.Date date)
//package com.java2s; public class Main { public static int getHour(java.util.Date date) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTime(date);// w w w. ja v a 2s .com return c.get(java.util.Calendar.HOUR_OF_DAY); } }