Re: FileDateTime for Internet web page



Hi Mogwai,

Unfortunately, if you have no control over the web server, there's not much you can do. The web server is returning the "Last-Modified" header as part of its HTTP response. So if it's not telling the truth (or if there is some technical reason that the file is modified often or recreated often), you'll get useless information back.

Here's a way to request just the HTTP headers - should be pretty fast:

Public Function gsGetLastModifiedDate(rsURL As String) As String
   Dim x As Object

   On Error GoTo ErrHandler

   Set x = CreateObject("MSXML2.XMLHTTP.5.0")

   x.Open "HEAD", rsURL, False
   x.send
   gsGetLastModifiedDate = x.getResponseHeader("Last-Modified")

ExitRoutine:
   Set x = Nothing
   Exit Function
ErrHandler:
   Resume ExitRoutine
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mogwai wrote:
Hi Jake,

Thanks for this.

I would be talking about a remote web page, so don't have direct
access as such.

I am trying to get the Date/Time a page was up-loaded to a web server,
as I believe this to be the most accurate Date/Time (assuming the
Server clock is correct).

I know there is Javascript, that can alert the Date/Time for a page
and the Properties of a page can also show Date/Time details, but
these don't always match or appear accurate!?!

Is there no definitive means to finding out when a remote web page
(Internet/Intranet) was created/up-loaded other than the authors word?

Heres a random example:

On following WebPage [ http://www.toggle.org/html/0409art6.htm ] the
author has indicated that the information was published "Number 256 -
September 2004", however the Page properties say the page was Created
and Modified on "06/02/2005". If you follow the instruction within the
page and enter the Javascript into the address bar, you get the
following "01/01/1970 01:00:00"  ...they can't all be right?

Thanks

.


Loading