Java Date getHours() Method
The getHours() method of Java Date class returns the value between 0 to 23 which represents the hour within the day by this date object. This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.HOUR_OF_DAY)
It returns the hours of the day represented by this date object.
Example 1Test it Now
Hour of the day is : 10