Results 1 to 3 of 3

Thread: javascript date updating

  1. #1
    Junior Registered rejean's Avatar
    Join Date
    Mar 2004
    Location
    Cape Breton Island Nova Scotia Canada
    Posts
    6

    javascript date updating

    Hi everyone!
    A friend of mine has the following script but the new update gives her 104 instead of 2004 for the year. How could she modify her script to make it work?
    Thanks in advance.
    Réjean
    <script language="JavaScript">
    function initArray()
    {
    this.length = initArray.arguments.length
    for (var i=0;i<this.length;i++)
    this[i+1] = initArray.arguments[i]
    } // end initArray.

    var DOWArray = new initArray("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    var MOYArray = new initArray("January", "February", "March", "April", "May", "June", "July", "August","September", "October", "November", "December");
    var LastModDate = new Date(document.lastModified);
    document.write("&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I first published my site February 17, 2004.&nbsp;&nbsp;&nbsp <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I last updated on");
    document.write(DOWArray[(LastModDate.getDay()+1)],", ");
    document.write(MOYArray[(LastModDate.getMonth()+1)]," ");
    document.write(LastModDate.getDate(),", ",LastModDate.getYear());
    document.write(".<P>");

    </script>




    </td>
    </tr></body>
    </html>


  2. #2
    Junior Registered rejean's Avatar
    Join Date
    Mar 2004
    Location
    Cape Breton Island Nova Scotia Canada
    Posts
    6
    Hi again!
    I went and checked my friend's site with IE 6.0 and the script seems to be working fine. The problem appears when using Netscape 6.0, Mozilla 1.7 or Firefox 0.8. If that can help!
    Thanks in advance,
    Réjean

  3. #3
    Junior Registered
    Join Date
    May 2004
    Posts
    1
    Quote Originally Posted by rejean
    Hi everyone!
    A friend of mine has the following script but the new update gives her 104 instead of 2004 for the year. How could she modify her script to make it work?
    Thanks in advance.
    Réjean
    you can get your solution here:
    http://tech.irt.org/articles/js199/index.htm

    I recommend using the y2K function as this will work on the widest range of browsers.

Similar Threads

  1. Cross linking sites with javascript
    By Pietertje in forum Search Engine Optimization
    Replies: 6
    Last Post: 04-25-2004, 12:36 PM
  2. Google & Javascript...
    By incka in forum Search Engine Optimization
    Replies: 10
    Last Post: 03-18-2004, 09:00 AM
  3. Javascript Links
    By Mike in forum HTML, CSS, Layout, and Design
    Replies: 19
    Last Post: 12-25-2003, 09:34 AM
  4. How come (javascripT)
    By Johan H in forum Search Engine Optimization
    Replies: 4
    Last Post: 10-01-2003, 06:16 PM
  5. javascript technique
    By RyaninZion in forum Search Engine Optimization
    Replies: 3
    Last Post: 08-25-2003, 08:48 AM

Bookmarks

Posting Permissions

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