Last Modified problems

A

Amanda

Hi, hope you can help me with this one.

If I want to get the date a page has been last modified, I can do something
like ..

document.write("<b>Last updated: "+document.lastModified+"</b>");

Can I use this to display the date that other pages were last modified - eg
other pages on my website?
I want my index.htm to display the last modified date of other pages on the
website without me manually updating.

Thanks!
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
If I want to get the date a page has been last modified, I can do something
like ..

document.write("<b>Last updated: "+document.lastModified+"</b>");

If you use that form on the Web, some browsers will display the American
date format, even to users in Europe. So only modify when, in the date,
D=M or D>12. Moreover, the year may be two-digit, and Easterners read
dates with year first.

Can I use this to display the date that other pages were last modified - eg
other pages on my website?
I want my index.htm to display the last modified date of other pages on the
website without me manually updating.

It is in fact not the date that the file was last "really" modified, but
the date of the last upload or change that lastModified contains. It is
IMHO better to use a more subtle scheme, such as editing manually or by
running a local program [+], to record when the last change that the
reader needs to know about was made, and to do so unambiguously - e.g.
2003-06-30 or 2003 Jun 30.

See <URL:http://www.merlyn.demon.co.uk/js-date3.htm#lM> about
lastModified.

I don't know a way to get the lastModified of another page [*], which
suggests that there may not be a reasonable one.

[+] DOS Batch program up-dates.bat, to be uploaded into directory
<URL:http://www.merlyn.demon.co.uk/programs/>, uses other programs HUNT,
COLS, EKKO, NOWMINUS in that directory to generate an HTML page
alphabetically listing *.htm files and dates for the current directory.
Possibly to be developed. Currently gives (format adaptable) lines like
<li> 2003/06/19-18:55:50   <a href="batfiles.htm">BATFILES.HTM</a>
Note : 8.3 filenames ONLY (for LFN, modify to use DOS dir command).

[*] One might be able to load that other page into a frame, and access
its lastModified, but that would require loading the other page in full,
probably largely defeating the object of the exercise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top