month 0 is January
year 0 is 1900


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16992 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-04-03 21:22:21 +00:00
parent f51fb4696c
commit 52f8cb492d
+3 -5
View File
@@ -6,17 +6,15 @@
bool bool
isLeapYear(const int year) isLeapYear(const int year)
{ {
if ((year % 400 == 0)||(year % 4 == 0 && year % 100 == 0)) int realYear = year + 1900;
return true; return ((realYear % 400 == 0)||(realYear % 4 == 0 && realYear % 100 != 0));
else
return false;
} }
int int
getDaysInMonth(const int month, const int year) getDaysInMonth(const int month, const int year)
{ {
if (month == 2 && isLeapYear(year)) { if (month == 1 && isLeapYear(year)) {
return 29; return 29;
} }