1) (i)date('L') should return the same (1 if is leap year, 0 otherwise), but they aren't outputing the same echo date('L'); //1 echo idate('L'); //0
Yes, this is indeed a bug in the isleap macro (you needed to call it with double parens), the fix is
diff -u -r1.120 datetime.c --- ext/standard/datetime.c 31 Mar 2004 17:57:33 -0000 1.120 +++ ext/standard/datetime.c 24 Jun 2004 12:10:55 -0000 @@ -64,7 +64,7 @@ {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} };
-#define isleap(year) (((year % 4) == 0 && (year % 100) != 0) || (year % 400)==0)
+#define isleap(year) ((((year) % 4) == 0 && ((year) % 100) != 0) || ((year) % 400)==0)
#define YEAR_BASE 1900
/* {{{ proto int time(void)
2) idate('y') is supposed to return the year with *two*digits, althought it returns just 4. This can be fixed with a simple sprintf?
An integer cannot have leading zeros so the behaviour is correct. The documentation could be changed to reflect the fact the the integer value of the last two digits is returned, not the actual two digits (which would be a string and you should use date() for that).
- Chris
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php