Q: I would like to be able to put the current time and date on my homepage. Is there a CGI script (or something else) that will "grab" this info and display it on my page whenever someo
ne loads it?
- Dante
A: Since you
indicated CGI as a possible solution,
I'll assume you'd like to display the time that's recorded on the server. (To display
the time that's on a local machine, you could use Java or JavaScript, but I won't get into
that
this time.) If your server supports NCSA
HTTPd-style server-side includes, you can do this easily without any messy CGI
scripts. Just make sure your webmaster has SSI turned on, and
put a line like this i n your document:
<!--#echo var="DATE_LOCAL"-->
Which should produce:
Wednesday, 29-Oct-97 19:37:44 PST
The characters <!-- and --> surround HTML comments, which aren't
actually displayed on the page. Before an HTTP server sends out a page, it scans it for comments that begin with a pound sign (#). When it finds one, it checks the command after the # (in this case, echo) and executes an action depending on the arguments that follow it (var="DATE_LOCAL"). If you need more information on format standards, the NCSA has a full description.
next page»