Closed Bug 396060 Opened 17 years ago Closed 17 years ago

Javascript Date.getYear() returning wrong data

Categories

(Firefox :: Tabbed Browser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: alhembd, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

I work for a contractor for the Harris County Toll Road Authority.  They use an internal web application we have developed using Oracle WEB PL/SQL Toolkit.  We have embedded Javascripts in our web pages.

In a Javascript, when we create a new Date object, and then go date.getYear(), instead of returning "2007" it returns "107."  The same Javascript does not do this in Internet Explorer.

It appears to be a FireFox bug.

Reproducible: Always

Steps to Reproduce:
1. Create a Javascript.
2. Create a new Date() object.
3. Display the object's getYear() value.
Actual Results:  
getYear() will display "107" instead of "2007."

Expected Results:  
Should return "2007."
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
The standard if getFullYear(), since getYear() has the Y2K bug. IE does it incorrect (getYear returns the same as getFullYear).
Status: RESOLVED → VERIFIED
I'm getting the same bug with getFullYear().  It also is returning 100 instead of 2000.

Al
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
Are you sure ? That's not what I see type
javascript:var d = new Date(2000,1,1); alert(d.getFullYear());
in the locationbar.
You're right!  It's an Oracle bug.  Somehow, the Oracle web server pushes out something that is not compatible with Firefox.  IE lets it go by...

Oh well...open up a tar at MetaLink (and wait about a year....)

Thanks,

Al
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Resolution: FIXED → INVALID
I came across this same problem, seen that this was already submitted but from the comments seems this is being written off as an Oracle web server issue. It's not. I found this on a static web page and this is the syntax which produces different results dependent upon which browser is used. (IE or Firefox) I have a snapshot of the browsers side-by-side with the snippet of code but unable to submit. But here is the function producing the problem.

document.write(currentDate.getYear());

Hope this helps.  (PS. My version of firefox is 2.0.0.8)

-Barry
You need to log in before you can comment on or make changes to this bug.