Here you can find the source of getHour(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static int getHour(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getHour(Date date) { Calendar cld = Calendar.getInstance(); cld.setTime(date);/*from w w w . j av a 2s . c o m*/ return cld.get(Calendar.HOUR_OF_DAY); } }