Link to home
Start Free TrialLog in
Avatar of kachan
kachan

asked on

date of an html file

Is there any way we can include the date of the html file automatically??

Also, is it possible to check the date of a file (other than the html itself) and put it into a html??

TIA
-=Terence=-
Avatar of chump
chump

If your Server handles "Server Side Includes" (SSI), put a
 <!--#flastmod file="foo.html" -->
in your HTML-Code.
(more info on SSI using Apache Webserver can be found here:
http://www.apacheweek.com/features/ssi).

If you like to use JavaScript, you can also use this code for the date of the current HTML-File:

<SCRIPT LANGUAGE="JavaScript">
<!--
var x= new Date(document.lastModified);
document.writeln(x.toString());
// -->
</SCRIPT>

Avatar of kachan

ASKER

In fact, the way that you shown can only indicate the date of the current html, but I am actually trying to get the date for a gif file that I am going to display.

TIA
-=Terence=-

True for the Javascript-part. But with SSI:
 <!--#flastmod file="displayed.gif" -->
or
 <!--#flastmod virtual="/pics/displayed.gif" -->

ASKER CERTIFIED SOLUTION
Avatar of DannyAyers
DannyAyers

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial