getHours function

int getHours(
  1. DateTime date
)

Returns the hour component of the given date.

date: The date for which the hour component is to be determined.

Returns an integer representing the hour component.

Implementation

int getHours(
  DateTime date,
) {
  return date.hour;
}