Firefox Problem with getYear

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wangers16
    New Member
    • Jul 2007
    • 57

    Firefox Problem with getYear

    Hi,

    I have the following code:

    [HTML]date = new Date();
    update = date.getYear();
    document.write( '<p class="copyrigh t" align="center"> © ' + update +' <a href="javascrip t:validate(\'' + link + '\')">'+ compname + '<\/a>. All Rights Reserved.');[/HTML]

    It works ok in IE however in Firefox it keeps displaying 108 instead of 2008, how would I get it to work in Firefox?

    I expect this is a simple problem, if it is just let me know ok

    thnks in advance

    DO NOT ANSWER THREAD AS I HAVE FOUND A SOLUTION AND I CANNOT DELETE IT SO JUST IGNORE IT OK
    Last edited by wangers16; Feb 22 '08, 12:20 AM. Reason: Found Solution
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Originally posted by wangers16
    DO NOT ANSWER THREAD AS I HAVE FOUND A SOLUTION AND I CANNOT DELETE IT SO JUST IGNORE IT OK
    I'll answer it anyway, just in case someone has a similar problem. getYear() is deprecated and not year 2000 compliant. Everyone should use getFullYear() instead.

    Comment

    Working...