Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Location
    Chattanooga, Tennessee USA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    site update code problem

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use getFullYear instead of the Y2K damaged getYear:

    datYear = datUpdated.getFullYear() ;
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •