469,323 Members | 1,198 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Firefox Problem with getYear

Hi,

I have the following code:

[HTML]date = new Date();
update = date.getYear();
document.write('<p class="copyright" align="center"> ' + update +' <a href="javascript: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
Feb 22 '08 #1
1 1530
acoder
16,027 Expert Mod 8TB
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.
Feb 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by NewmanBT | last post: by
4 posts views Thread by Schraalhans Keukenmeester | last post: by
6 posts views Thread by Franz | last post: by
3 posts views Thread by Joel Byrd | last post: by
2 posts views Thread by fedorpawel | last post: by
8 posts views Thread by Paul E. Schoen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.