If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

bit.pt - displays "year 19101" (getYear, y2k)



Tech Evangelism Graveyard
16 years ago
3 years ago


(Reporter: andrelourenco, Assigned: Tristan Nitot)



(Whiteboard: [XBROWSER-JS], URL)



16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010628
BuildID:    2001062815

at www.bit.pt we can see a date (portuguese):
Domingo, 22 de Julho de 19101

19101 should be 2001

Reproducible: Always
Steps to Reproduce:
1.go to www.bit.pt
2.check a date (in portuguese) near the top-right corner

Actual Results:  the year 2001 appears as 19101

Expected Results:  2001

this is the script that generates the date:


var mydate=new Date()

			var year=mydate.getYear()

			if (year<2000)


			var day=mydate.getDay()

			var month=mydate.getMonth()

			var daym=mydate.getDate()

			if (daym<10)


			var dayarray=new Array("Domingo","Segunda Feira","Terça Feira","Quarta
Feira","Quinta Feira","Sexta Feira","Sábado")

			var montharray=new

			document.write("<small><font color='#FFFFFF' face='Arial'><b>"+dayarray[day]+",
"+daym+" de "+montharray[month]+" de "+year+"</b></font></small>")


Comment 1

16 years ago
See bug 45764 and bug 22964 for why getYear returns what it does in 4.x and in 
Mozilla.  The site should use mydate.getFullYear(), which returns a four-digit 
year in 4.x, Mozilla, and IE.

-> evang, confirmed.
Assignee: rogerl → bclary
Severity: major → minor
Component: Javascript Engine → Evangelism
Ever confirmed: true
QA Contact: pschwartau → zach
Summary: year 2000 bug (?) → www.bit.pl displays "year 19101" (getYear, y2k)

Comment 2

16 years ago
Jesse is correct -

getYear() returns the number of years after 1900, i.e. 101.
Since this is <2000, the code above adds a "19" in front of it: 19101.

getFullYear() is the function to use - it will return 2001 as desired. 

Comment 3

16 years ago
All Evangelism Bugs are now in the Product Tech Evangelism. See bug 86997 for
Component: Evangelism → US English
Product: Browser → Tech Evangelism
Version: other → unspecified

Comment 4

16 years ago
-> Euro
Assignee: bclary → nitot
Component: US English → European
QA Contact: zach → momoi
Summary: www.bit.pl displays "year 19101" (getYear, y2k) → bit.pl - displays "year 19101" (getYear, y2k)


16 years ago
Summary: bit.pl - displays "year 19101" (getYear, y2k) → bit.pt - displays "year 19101" (getYear, y2k)

Comment 5

16 years ago
Moving to new component "West Europe".  European component is being removed. 
See bug 95808 for details.
Component: European → West Europe
QA Contact: momoi → caillon

Comment 6

16 years ago
In Mozilla 9.4 getYear returns 101 for 2001.

This is not correct. Function getYear is defined to return year minus 1900 for
years until 2000 and the full year after 2000.

So: for 1999 getYear should return 99
 - for 2001 getYear should return 2001

Comment 7

16 years ago
No it's not. See the aforementioned bug 22964 and bug 45764 for more explanation.

Comment 8

16 years ago
contact info found here: http://www.bit.pt/contactos.htm
General contact: geral@bit.pt
Director, Pedro Amaral: pamaral@bit.pt

But this seems to be fixed on build 2001111303 on win2k and also on a recent
build on Linux. Marking Resolved fixed.

Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 9

16 years ago
Yep, fixed.  Verifying on linux 2001112008-
Whiteboard: [XBROWSER-JS]

Comment 10

15 years ago
tech evang june 2003 reorg
Component: Europe: West → Portuguese
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.