JavaScript날짜getHours

getHours날짜

시(0~23)를 반환합니다.

문법

date.getHours()

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

const
new
console
getHours
const date = new Date();
console.log(date.getHours());   // current hour (0-23)