Copyright © tutorialspoint.com
Javascript date getUTCHours() method returns the hours in the specified date according to universal time. The value returned by getUTCHours is an integer between 0 and 23.
Date.getUTCHours() |
Here is the detail of parameters:
NA
Returns the hours in the specified date according to universal time.
The following example prints the hours portion of the current time to the variable hrs.
<html> <head> <title>JavaScript getUTCHours Method</title> </head> <body> <script type="text/javascript"> var dt = new Date(); document.write("getUTCHours() : " + dt.getUTCHours() ); </script> </body> </html> |
This will produce following result for Indian time zone:
getUTCHours() : 14 |
To understand it in better way you can Try it yourself.
Copyright © tutorialspoint.com