473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Last Modified problems

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!

Jul 20 '05 #1
1 3201
JRS: In article <bd**********@hercules.btinternet.com>, seen in
news:comp.lang.javascript, Amanda <ad*****@hotmail.com> posted at Sun,
29 Jun 2003 17:22:05 :-
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.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Dennis Marks | last post by:
There seems to be a major program with the automatic display of the last modified date. Using the javascript "document.lastModified" sometimes returns the correct date and sometimes 1 Jan 1970...
7
by: laredotornado | last post by:
Hello, Does anyone know how (or if) I can figure out the last time a web page was last modified if my only access to it is via HTTP (a web browser). Right now, I'm looking at "Page Info" options....
5
by: Steel | last post by:
Hi at all it is the first time that I use PHP and I need only to modify the last modified date of a file I maked a FIRST little script like this: $FileName="myfile.txt"; $Today...
3
by: RAMohrmann | last post by:
Greetings, I am attempting to view all files in a directory and if those files have not been modified within the last couple days I will remove them. In order to do this I need to look at the...
9
by: mazen.s.m | last post by:
I have been trying to find a way to get the Domain and UserName of the user that last modified a file. I know how to get the owner of the file via WMI or Win32, but I can't find a way to get the...
1
by: Svetac | last post by:
Hi, I use a script that shows when the page was last modified. It works fine for just one html file. The thing I would like to do is that the script shows me of last modified file in root...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format the Last-Modified date with javascript?...
3
by: Gretsch | last post by:
Web, html, javascript, Hi, I need to calculate the time since this .htm file was last modified. {which I can then use in a calculation, rather than display, so days&decimals format would be OK}...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.