472,096 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

last modified date of a web page?

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. There is a
"Modified" field but I think that is telling me the time that the file
was downloaded to my machine.

Any advice is greatly appreciated, - Dave

Jul 23 '05 #1
7 40747
Once upon a time *l************@zipmail.com* wrote:
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. There is a
"Modified" field but I think that is telling me the time that the file
was downloaded to my machine.

Any advice is greatly appreciated, - Dave


Depends on the browser I'll guess, what date you see via HTTP. With IE
you see the "today" date when you downloaded the page. With Mozilla I
see the "modified" date in Page Info options, not the date when I
download it.

--
/Arne
http://hem.bredband.net/b450204/
Proud User of Mozilla Suite. Get your free copy here:
*English* http://www.mozilla.org/products/mozilla1.x/
Jul 23 '05 #2
la***********@zipmail.com wrote:
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).


The server can (optionally) send a Last-Modified HTTP header. Failing that,
there isn't really anything you can do (save for polling it at intervals
and recording the time when it changes)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3
In article <11**********************@z14g2000cwz.googlegroups .com>,
la***********@zipmail.com wrote:
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. There is a
"Modified" field but I think that is telling me the time that the file
was downloaded to my machine.

Any advice is greatly appreciated, - Dave


Well, given that html isn't a programming languages, how would you do
this on your browser? Javascript? Don't know how that would work.
What do you want to do with this information once you have it anyway?
HTML isn't capable of storing anywhere. You need a programming language
for that.

The most common way to do this is with a programming language like perl
or php as these run on the server where the file is stored. Or you can
simply insert a "server-side include" directive to display the modified
date of the page, if your server supports this. This, of course,
depends on your server. If your ISP doesn't support server side
includes or CGI or php, you're out of luck.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 23 '05 #4
"" wrote in comp.infosystems.www.authoring.html:
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. There is a
"Modified" field but I think that is telling me the time that the file
was downloaded to my machine.


More likely the page is created on the fly by the server.

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 23 '05 #5
la***********@zipmail.com wrote:

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. There is a
"Modified" field but I think that is telling me the time that the file
was downloaded to my machine.

Any advice is greatly appreciated, - Dave


The "Modified" date in "Page Info" is indeed when the page was last
changed. However, if the page involves a server-side include
(e.g., for a counter), the server modifies the page as it sends it
to your browser. In this case, the "Modified" date is the same as
the download date.

The only way to see the true date when the HTML file was last
changed on the server is to examine its directory. You would then
see something like this:

Index of /~rossde/cgi-bin
Name Last modified Size Description
[DIR] Parent Directory 08-Mar-2005 08:31 -
[TXT] Arch_Script.ksh 30-Oct-2003 21:55 1k
[TXT] Rest_Script.ksh 03-Oct-2003 19:14 1k
[TXT] back.tidx 26-Sep-2004 12:20 1k
[TXT] cnt_Canada_trip.dat 08-Mar-2005 10:43 1k

However, for security, most servers allow only the owner of the
directory to see this unless the owner grants permission to other
users. I tried to view my own public_html directory, but I was not
successful. I can view it via either FTP or TELNET, but my ISP
does not allow that via my browser.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 23 '05 #6
la***********@zipmail.com wrote:
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. There is a
"Modified" field but I think that is telling me the time that the file was downloaded to my machine.

Any advice is greatly appreciated, - Dave


If you have PHP enabled on your web server you can do something like
this:

HTML:
<html>
<head>
<title>Modified</title>
</head>
<body>
<!-- may be wrapped, please unwrap to make single line -->
This page was last modified: <script language="JavaScript"
src="modified.php"></script>
</body>
</html>

php code:

<?php
//
// gets the server timezone, can be changes to the timeszone you want
// like this:
// putenv("TZ=America/Los_Angeles");
//
putenv(getenv('TZ'));
//
// change to your file name
//
$filename = "modified.html";
//
// return javascript document.write command
// (may be wrapped, please unwrap to make single line)
echo "document.write('".date( "F d, Y. H:i:s a", filemtime
($filename))."');";
?>

Jul 23 '05 #7
MrBaseball34 wrote:

la***********@zipmail.com wrote:
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. There is a
"Modified" field but I think that is telling me the time that the

file
was downloaded to my machine.

Any advice is greatly appreciated, - Dave


If you have PHP enabled on your web server you can do something like
this:

HTML:
<html>
<head>
<title>Modified</title>
</head>
<body>
<!-- may be wrapped, please unwrap to make single line -->
This page was last modified: <script language="JavaScript"
src="modified.php"></script>
</body>
</html>

php code:

<?php
//
// gets the server timezone, can be changes to the timeszone you want
// like this:
// putenv("TZ=America/Los_Angeles");
//
putenv(getenv('TZ'));
//
// change to your file name
//
$filename = "modified.html";
//
// return javascript document.write command
// (may be wrapped, please unwrap to make single line)
echo "document.write('".date( "F d, Y. H:i:s a", filemtime
($filename))."');";
?>


Since my Web server is Apache with server-side includes enabled, I
do that all with the following at the point where I want to see the
date:
<!--#config timefmt="%e %B %Y" -->
<!--#echo var="LAST_MODIFIED" -->
I usually make a single line of the two commented statements, but
they still have to be two distinct comments. No script is
required.

Note, this displays in [day month year] format with the month
spelled out and a four-digit year. Use <!--#config timefmt="%B %e,
%Y" --> for [month day, year] format.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Shawn McKenzie | last post: by
1 post views Thread by Amanda | last post: by
11 posts views Thread by Dennis Marks | last post: by
5 posts views Thread by Steel | last post: by
6 posts views Thread by SQLcat | last post: by
3 posts views Thread by Rarpy | last post: by
1 post views Thread by Svetac | last post: by

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.