Closed Bug 91853 Opened 23 years ago Closed 23 years ago

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

Categories

(Tech Evangelism Graveyard :: Portuguese, defect)

x86
Windows 98
defect
Not set
minor

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: andrelourenco, Assigned: tristan)

References

()

Details

(Whiteboard: [XBROWSER-JS])

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
3.

Actual Results:  the year 2001 appears as 19101

Expected Results:  2001

this is the script that generates the date:

<script>

var mydate=new Date()

			var year=mydate.getYear()

			if (year<2000)

			year="19"+year

			var day=mydate.getDay()

			var month=mydate.getMonth()

			var daym=mydate.getDate()

			if (daym<10)

			daym="0"+daym

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

			var montharray=new
Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro")

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

	 </script>
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
Status: UNCONFIRMED → NEW
Component: Javascript Engine → Evangelism
Ever confirmed: true
QA Contact: pschwartau → zach
Summary: year 2000 bug (?) → www.bit.pl displays "year 19101" (getYear, y2k)
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. 
All Evangelism Bugs are now in the Product Tech Evangelism. See bug 86997 for
details.
Component: Evangelism → US English
Product: Browser → Tech Evangelism
Version: other → unspecified
-> 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)
Summary: bit.pl - displays "year 19101" (getYear, y2k) → bit.pt - displays "year 19101" (getYear, y2k)
Moving to new component "West Europe".  European component is being removed. 
See bug 95808 for details.
Component: European → West Europe
QA Contact: momoi → caillon
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
No it's not. See the aforementioned bug 22964 and bug 45764 for more explanation.
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.

Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Yep, fixed.  Verifying on linux 2001112008-
Status: RESOLVED → VERIFIED
Whiteboard: [XBROWSER-JS]
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.