Results 1 to 4 of 4

Thread: lastModified problems in Netscape 6

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316

    lastModified problems in Netscape 6

    I've been using this script for a while without trouble, but I was redesigning my site, and decided to take a look at the layout with Netscape 6, since my logs are showing more users visiting with this browser. I was a bit suprised to see that my footer script, printing the date of the last file modification was showing up incorrectly. Can someone help. Here is the script:

    Code:
    <script language="JavaScript"><!--
    function makeArray0() {
         for (i = 0; i<makeArray0.arguments.length; i++)
              this[i] = makeArray0.arguments[i];
    }
    
    var days = new makeArray0("Sunday","Monday","Tuesday","Wednesday",
        "Thursday","Friday","Saturday");
    
    var months = new makeArray0('January','February','March',
        'April','May','June','July','August','September',
        'October','November','December');
    
    function nths(day) {
         if (day == 1 || day == 21 || day == 31) return 'st';
         if (day == 2 || day == 22) return 'nd';
         if (day == 3 || day == 23) return 'rd';
         return 'th';
    }
    
    function getCorrectedYear(year) {
        year = year - 0;
        if (year < 70) return (2000 + year);
        if (year < 1900) return (1900 + year);
        return year;
    }
    
    function y2k(number) { return (number < 1000) ? number + 1900 : number; }
    
    var last = document.lastModified;
    var date = new Date(last);
    var dateY2K = new Date(getCorrectedYear(date.getYear()),date.getMonth(),date.getDate());
    
    document.write("Last updated on " + days[dateY2K.getDay()] + ' ' +
        dateY2K.getDate() + nths(dateY2K.getDate()) + " " +
        months[dateY2K.getMonth()] + ", " +
        (y2k(dateY2K.getYear())) + ".");
    //--></script>
    In Netscape 6, I get: Last updated on Tuesday 31st December, 2069.
    In IE 4,5 and Netscape 4 I get: Last updated on Monday 6th August, 2001.

    Thanks for the help.

  2. #2
    scoutt
    Guest
    worked fine for me in NS6.1

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    I'm just wondering, would it matter if I am pulling this script in as an include file?

    I'm calling the file in the following manor:

    Code:
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    Body of the message
    <!--#include virtual="../include/footer.html"--> 
    </body>
    </html>
    Could this be the culprit?

    Thanks

  4. #4
    scoutt
    Guest
    I wouldn't think so. but if you are calling it from an include then does it check if the footer.html has been modified or do youwant it to see if the index has been modified. I would think since it is in the footer that it would only look for the date on the modification on this instead of the index.

    what you could do is take the include out and see if it make a difference.

Posting Permissions

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



Click Here to Expand Forum to Full Width