Displaying the Current Date and Time
The date and time described in this section are those that are on the server.
Date
To display the current date by itself in a Web page, type:
<% =date %>
at the point where you want it to appear. When you view the page in your browser, you should see something like this:Thu, Jan 23, 1997.
Time
To display the current time by itself, type:
<% =time %>
where you want it to appear. When you view the page, you should see something like this:4:19:46 PM.
Displaying Text
len
The len function tells you how many characters are in a word or sequence of words.
(The name “len” is an abbreviation of “length.”) All characters are counted, including the space character. For example, to find the length of the sentence “The cat is on the mat,” type this into a Web page:
There are <% =len("The cat is on the mat.") %> characters
in "The cat is on the mat."
When you view the page in Internet Explorer, you should see this:There are 22 characters in “The cat is on the mat.”
For more Click Here
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment