Display Time ASP Script - ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

ASP Scripts

DISPLAY TIMES

There are lots of ways to display times on your web pages. Here are several quick ways to do it with ASP / VBScript:

<HTML>
<HEAD><TITLE>Printer Friendly Page</TITLE></HEAD>
<BODY>

<% Response.Write FormatDateTime(Time, vbShortTime) %>

</BODY>
</HTML>

This displays the time like this: 22:27

<HTML>
<HEAD><TITLE>Printer Friendly Page</TITLE></HEAD>
<BODY>

<% Response.Write FormatDateTime(Time, vbLongTime) %> or
<% = Time %>

</BODY>
</HTML>

These both display the time like this: 22:27:12

You could also these methods to display a portion of the time:

<HTML>
<HEAD><TITLE>Printer Friendly Page</TITLE></HEAD>
<BODY>

<%= Hour(Now) %> : <%= Minute(Now) %> : <%= Second(Now) %>

</BODY>
</HTML>

This displays the time like this: 22 : 27 : 12

< Back to ASP Scripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
06 July 2008