getHoursintermediateconst d = new Date(2024, 0, 15, 14, 30)
d.getHours() // β 14
// returns 0β23Use getHours() to retrieve the hour (0β23) of a Date object in local time.
You can compare hours of two dates to determine which is earlier in the day.
Challenge: Verify that new Date(2024, 0, 15, 12).getHours() > new Date(2024, 0, 15, 8).getHours().