In gregorian calendar aplies following rule

isLeapYear = (year mod 4 = 0) and ((not year mod 100 = 0) or (year mod 400 = 0))  

2000 mod 4 = 0 -> true
not 2000 mod 100 = 0 -> false
2000 mod 400 = 0 -> true

true and (false or true) -> true

> -----Original Message-----
> From: Felipe Schnack [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 06, 2003 12:50 PM
> To: Tomcat Users List
> Subject: bug in java api? (ot)
> 
> 
>   Take a look at the following code
> 
> GregorianCalendar cal = (GregorianCalendar)Calendar.getInstance();
> cal.set(2000, Calendar.FEBRUARY, 1);
> System.out.println(cal.isLeapYear(2000));
> 
>   Shouldn't "false" be printed on the screen? I see "true" here in my
> machine :-)
> 
> -- 
> 
> Felipe Schnack
> Analista de Sistemas
> [EMAIL PROTECTED]
> Cel.: (51)91287530
> Linux Counter #281893
> 
> Centro Universit�rio Ritter dos Reis
> http://www.ritterdosreis.br
> [EMAIL PROTECTED]
> Fone/Fax.: (51)32303341
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to