Javascript Date() and getYear() are incompatible

VERIFIED DUPLICATE of bug 22964

Status

()

Firefox
General
--
critical
VERIFIED DUPLICATE of bug 22964
14 years ago
14 years ago

People

(Reporter: Chris, Assigned: Blake Ross)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win98; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Windows; U; Win98; rv:1.7.3) Gecko/20040913 Firefox/0.10

<script>
now=new Date()
alert (now.getYear()+" from "+now)
</script>

gets it horribly wrong.

Reproducible: Always
Steps to Reproduce:
1.Put the details above on a web page.
2.Load the page.
3.Whisper epithet

Actual Results:  
The software puts the year in one place then looks for it in another.

Expected Results:  
Used the same data specification for both routines?

Any data collection web page that collects date and time automatically (eg for
audit or sequencing purposes) will get corrupt data.

I cannot use Firefox in house without an expensive and kludgy workaround that
will take longer to write than I hope the bug will take to fix!  Equipment would
get double booked because prior bookings would end up in a different (random)
year :(

Comment 1

14 years ago
Presumably you're referring to the fact that getYear() returns 104, that's
because you should be using getFullYear() instead.

*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.