Returns the hour component of a Datetime as an integer.
Here is an example:
datetime myDatetime = datetime.newInstance(1998,12,12,8,20,56); Integer hour = myDatetime.hour(); system.debug(hour);
Output: 8