Here you can find the source of getHours(java.util.Date _date)
public static int getHours(java.util.Date _date)
//package com.java2s; import java.util.Calendar; public class Main { public static int getHours(java.util.Date _date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(_date);//from w w w. j av a 2 s. c om int value = calendar.get(Calendar.HOUR); calendar.clear(); return value; } }