CodesJava

Easy learning with example program codes

JavaScript Date getUTCHours() method

The JavaScript date getUTCHours() method is used to get the integer value between 0 and 23 that represents the hours on the basis of universal time.

Syntax:

dateObj.getUTCHours()

Return:
An integer value between 0 and 23.

Example:

<!DOCTYPE html>
<html>
<body>
<script>   	 
var today = new Date(); 	 
document.writeln(today.getUTCHours());   
</script>  
</body>
</html>

Output:

11
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status