# getHours method

The `getHours` method is applied to the date object and returns the value of the current hour (number from `0` to `23`).

## Syntax

`date.getHours();`

## Example

Let's output the current hour:

`let date = new Date(); let res = date.getHours(); console.log(res);`

## See also

- the `getDay` method
  that gets the day of the week
- the `getFullYear` method
  that gets the year
- the `getMonth` method
  that gets the month
- the `getDate` method
  that gets the day of the month
- the `getMinutes` method
  that gets the minutes
- the `getSeconds` method
  that gets the seconds
- the `getMilliseconds` method
  that gets the milliseconds

← →
↑
en ru