ASP/VBScript Hour() Returns a whole number between 0 and 23, inclusive, representing the hour of the day.
ShotDev Focus:
- Using Asp and Hour() function.
Syntax
Hour(time)
The time argument is any expression that can represent a time. If time contains Null, Null is returned.
The following example uses the Hour function to obtain the hour from the current time:
Example
asp_hour.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Response.write Hour(Now())&"<br>" Response.write Hour("01-Sep-2010 12:50:10")&"<br>" %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_hour.asp
Screenshot