473,399 Members | 4,192 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,399 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 41025
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Shawn McKenzie | last post by:
Can someone help me with a query to get the date/time that a database was last modified? I looked at the SHOW command but there was no mention of this. TIA, Shawn
1
by: Amanda | last post by:
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>"); ...
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...
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...
6
by: SQLcat | last post by:
I have a VBScript as follows: Dim xmlHTTP : Set xmlHTTP = CreateObject("Microsoft.XMLHTTP") Dim adoStream : Set adoStream = CreateObject("adodb.stream") Const bGetAsAsync = False ' wait for...
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...
3
by: Rarpy | last post by:
Hi all, I tried putting this at the beginning of a PHP file: <?php echo "Last-modified: " . date( "F d Y.", getlastmod() ); print ""; ?> The goal was to ensure that the browser would...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.