Closed
Bug 114401
Opened 24 years ago
Closed 21 years ago
getYear returns 101 not 01 or 2001
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: samuel, Assigned: rogerl)
References
()
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011120
BuildID: 2001112009
This script writes 101 to the viewed page.
<script language="javascript">
<!--
Today = new Date();
document.write(Today.getYear());
//-->
</script>
Reproducible: Always
Steps to Reproduce:
1.point your browser at www.cc-systems.com
2.Look in the lower right corner.
3.
Actual Results: Copyright © 101 CC Systems AB
Expected Results: Copyright © 2001 CC Systems AB
or
Copyright © 01 CC Systems AB
Comment 1•24 years ago
|
||
Problem is probably caused by line
http://lxr.mozilla.org/seamonkey/source/js/src/jsdate.c#803
Looking at the code at
http://lxr.mozilla.org/seamonkey/source/js/src/jsdate.c#774, there is a big
comment saying that one should use getFullYear() instead of getYear() or specify
the version of the script.
Recomment reporter try out these two solutions.
Comment 2•24 years ago
|
||
Should be marked WONTFIX, I remember an URL saying this is a normal 'buggy'
behaviour to respect previous implementations and scripts, and getFullYear()
should now be used to prevent this.
See http://developer.netscape.com/viewsource/goodman_2k.html and
http://www.xs4all.nl/~ppk/js/introdate.html for example.
Comment 3•24 years ago
|
||
Some URLs that describe problem and solution.
http://www.webdevelopersjournal.com/articles/javascript_limitations.html
http://wipos.p.lodz.pl/zylla/opera/introdate.html
Agreed: should be WONTFIX. Perhaps should get a comment somewhere in the
documentation.
see comments in bug 22964, bug 45764, bug 58241, bug 65681, bug 82354
*** This bug has been marked as a duplicate of 100123 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 5•24 years ago
|
||
Verified Duplicate - thanks to all who contributed on this.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
Comment 6•21 years ago
|
||
*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago → 21 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•