Economical Australian Domain Names
Home » Articles » ASP Tutorials » Displaying Date and Time in an ASP Page
Displaying Date and Time in an ASP Page

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.

This is a one-stop website that meets all your online business needs.This website offer domain registration, web hosting, email hosting, secure ssl certificate, internet software products and development services.
©2004-2009 EcoWeb4u Web Solutions | Queensland, Australia. All trademarks are the property of their respective owners.
A.B.N: 96 996 282 647