The setHours() method sets the hours of a date object (0-23):

Example

const d = new Date();
d.setHours(22);



Practice Excercise Practice now