Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date last modified

Status
Not open for further replies.

tayl0124

Technical User
Oct 1, 2005
1
US
I am having trouble with the output from this code.

<!-- Begin
var m = "Page Updated " + document.lastModified;
var p = m.length-8;
document.writeln("<right>");
document.write(m.substring(p, 0));
document.writeln("</right>");
// End -->


it out puts a date like this.

Page Updated Fri, 23 Sep 2005 22:3

the last number is not there. Anyone have any clue why?
 
I've checked this out in FF1.0.7 and IE6, and it gave me different results each time, so the output depends on your browser. I assume the line var p = m.length-8; is to get rid of the time. This might work for you:
Code:
var m = "Page Updated " + document.lastModified;
document.writeln("<right>");
document.write(m.substring(0,m.indexOf(new Date().getFullYear())+4));
document.writeln("</right>");


"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top