ASP Tutorial
When would I want to use a date and time stamp?
A date and time stamp is always important for several reasons. You may want to
display the date for users on your web page. You may want to mark someone's
visit or action with a time and/or date stamp. You may just need it for simple
record keeping purposes. To do so, there are several ASP functions that can be
used. Which one you would use depends upon how in depth of a record of time or
date that you need. These functions are reserved words in the ASP scripting
language. This means that you shouldn't use these names for variable names.
You'll need to remember that when we get to the data basing section.
Please review the terms below. These terms will be used in this section.
| Now |
Will print the time and date at
that very second, like this: 3/23/2001 12:11:11 PM |
|
| |
|
|
| Date |
This will print the date in
this format: 3/23/2001 |
|
| |
|
|
| Time |
This will print the exact time,
in this format: 12:11:11 PM |
|
| |
|
|
| <%= variable %> |
This syntax is just like: <%
response.write variable %> |
|
------------- Copy the following into
date_time.asp -------------
<HTML>
<HEAD>
<TITLE>Date_Time</TITLE>
</HEAD>
<BODY>
NOW is: <%= NOW %><BR>
Date is:<%= DATE %><BR>
Time is:<%= TIME %><BR>
</BODY>
</HTML>