There are a lot of ways to display times on your web pages. If you are using IIS/Windows server to host your website then you can display times in your web pages very easily. In this turotial, I will show you how to display date and time, hour, minute and seconds by using ASP code.
To display date and time in an ASP page, use the following code.
strDateTime = now()
Response.Write(strDateTime)
%>
To display time, use the following code.
strTime = time()
Response.Write(strTime)
%>
To display hour, use the following code.
strHour = hour(now)
Response.Write(strHour)
%>
To display minute, use the following code.
strMin = minute(now)
Response.Write(strMin)
%>
To display second, use the following code.
strSecond = second(now)
Response.Write(strSecond)
%>
See the example of the date_time.asp here.
Download date_time.asp file.
A.B.N: 96 996 282 647


