Tuesday, 29 November 2011

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:


Printer Friendly Page


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




This displays the time like this: 07:49


Printer Friendly Page


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




These both display the time like this: 07:49:02

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


Printer Friendly Page


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




This displays the time like this: 7 : 49 : 2

http://www.aspwebpro.com/aspscripts/dates/times.asp

No comments:

Post a Comment