Hour Function
Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Hour function returns a number between 0 and 23 that represents the hour of the day. Any expression that can represent a time. If time contains Null, Null is returned. Its parameter is time that describes an expression that can represent a time. The Hour function returns the hour by using the Time function as an argument. The output is base upon a 24 clock (military time, values will run from 0 to 23).


The Syntax of the Hour function is :-

Hour(time)

Example#1 :-

Code :-
document.write(Now & "<br />")
document.write(Hour(Now))
Output :-

1/15/2002 10:07:47 AM
10

Example#2 :-

Code :-
document.write(Hour(Time))
Output :-
10

Example#3 :-

Code :-
<%
Dim theHour 'create variable that will store the hour
theHour=Hour(Now)'we pass in the Now function as a parameter
Response.write theHour 'write out the hour
%>
Output :-

The hour here is: 8

Example#4 :-

Code :-
<% =Hour(Time) %>
Output :-
14

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641