JavaScript · More dates
date.getHours()
The local hour from 0 to 23. Use getUTCHours for UTC.
Syntax
date.getHours()Example
Try it
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.