# setHours method

The `setHours` method allows you to change the hour value of the date object. It takes hour as first parameter. It can also take minutes, seconds and milliseconds.

## Syntax

`date.setHours(hours, [minutes], [seconds], [milliseconds]);`

## Example

Let's set the hours for the current time:

`let date = new Date(); date.setDate(12); console.log(date);`

## Example

Let's set the hours, minutes and seconds for the current point in time:

`let date = new Date(); date.setDate(12, 59, 49); console.log(date);`

## See also

- the `setFullYear` method
  that sets the year
- the `setMonth` method
  that sets the month
- the `setDate` method
  that sets the day of the month
- the `setMinutes` method
  that sets the minutes
- the `setSeconds` method
  that sets the seconds
- the `setMilliseconds` method
  that sets the milliseconds

← →
↑
en ru