...

View Full Version : site update code problem



lgutherie
11-04-2004, 07:16 PM
My client has requested a "page last updated" on each of their 296 html pages. The code I used inside the body tags and inside a <td> is:
<script>
datUpdated = new Date(document.lastModified) ;
datMonth = datUpdated.getMonth() + 1 ;
datDate = datUpdated.getDate() ;
datYear = datUpdated.getYear() ;
document.write("<i>Last Updated: " + datMonth + "/" + datDate + "/" + datYear + "</i>") ;
</script>

Upon activating the site, I get a report from client....
"running Safari in Macís System 10, some pages say 11/1/104, some say 11/3/104 . . . It is 10/2/2004 (for example) on Pat Postís PC"....

instead of correctly, and as it shows on my three (PC) machine as 11/03/2004

the URL is http://www.nhchc.org

Can anyone help?
Thanks in advance.
Linda Gutherie

Roy Sinclair
11-04-2004, 07:42 PM
Use getFullYear instead of the Y2K damaged getYear:

datYear = datUpdated.getFullYear() ;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum