Java Date getHours() MethodThe 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) Syntax:ParametersNA ReturnIt returns the hours of the day represented by this date object. Example 1Test it NowOutput: Hour of the day is : 10
Next TopicJava Util Date
|