×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Web page date?
3

Web page date?

Web page date?

(OP)
Is there any way to determine the date that a web page was last revised? I tried contacting the web page owner without success. I want to verify if the information provided is current. Any suggestions?

RE: Web page date?

Add this to the body

CODE

<script language="Javascript">
<!--
var lastmod=new Date(document.lastModified);
document.write("<i>Last Modified: " + lastmod.toGMTString().slice(4,16) + "</i>");
//-->
</script>
If you leave out the slice, you will also get the time, day and other bits.

RE: Web page date?

(OP)
Thanks xwb!

I'm not familiar with HTML code so I'm not sure if I added it correctly. I viewed the source and pasted the code you provided into the source code. I was unable to see when the page was last revised. Where will this information appear? Does it make a difference where I insert the information you provided?

If I want to see the revision date, do I only leave "slice" out?

Thanks for your help.

RE: Web page date?

This is what it will look like: just copy it into a file and look at it in your browser.  If you leave slice out, you will get everything including the time.

CODE

<html>
<head><title>From Eng-Tips</title></head>
<body>
The stuff before<br>
<script language="Javascript">
<!--
var lastmod=new Date(document.lastModified);
document.write("<i>Last Modified: " + lastmod.toGMTString().slice(4,16) + "</i><br>");
//-->
</script>
The stuff after<br>
</body>
</html>

RE: Web page date?

Remember to give the file either a .htm or .html extension.

RE: Web page date?

Motorcity, the script xwb gave you has to be added by the webpage owner and then only AFTER the script has been added, will show the last revised date.

The only way to find out when it was revised (unless it shows in on the source already) is to contact the webpage owner. Sorry.

Chris

RE: Web page date?

2
Hi, its possibly a bit late to resurrect this post, but assuming that the page you want to find ends in .html or .htm and not .php or anything else, thne you can type this in the address bar and press enter:

javascript:alert(document.lastModified)

This will pop-up a little dialog box showing the date and time of the last update. This wont work for dynamically created pages like php scripts, as it will just give the time that the page finished downloading to your browser.

Hope this was of some help and wasn't too late!

RE: Web page date?

(OP)
StevoSimpson,

Thank you!! That is EXACTLY what I was looking for! Never too late for good advice.

MotorCity

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close