ID: 36401
Updated by: [EMAIL PROTECTED]
Reported By: marcel dot alburg at alkronet dot info
Status: Open
-Bug Type: Date/time related
+Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.1.2
New Comment:
6 0's here is not invalid, so marking as a doc problem.
Previous Comments:
------------------------------------------------------------------------
[2006-02-15 15:16:09] [EMAIL PROTECTED]
Ah, but, the documentation says:
"If the arguments are invalid (eg. if the year, month and day are all
0), the function returns FALSE (before PHP 5.1 it returned -1)."
Furthermore, I've just tested on an ancient PHP 4.0 I had lying around,
and mktime(0,0,0,0,0,0) does indeed return -1.
So it seems there's something to be resolved here, whether it be fixing
mktime or changing the documentation.
------------------------------------------------------------------------
[2006-02-15 13:42:42] marcel dot alburg at alkronet dot info
but in previosly versions it get 0 back.
because that i mean it's an error
thanks
marcel alburg
------------------------------------------------------------------------
[2006-02-15 13:35:19] [EMAIL PROTECTED]
Why? The result is correct. You're getting the timestamp for 0
january-1 (december of the previous year), year 0 (which is 2000) at
00:00:00. This is exactly 30 november 1999, 00:00:00
------------------------------------------------------------------------
[2006-02-15 13:31:15] marcel dot alburg at alkronet dot info
Description:
------------
If i enter
print mktime(0,0,0,0,0,0)
i get "943916400" but it must be "0"
print date('r', mktime(0,0,0,0,0,0));
returns
Tue, 30 Nov 1999 00:00:00 +0100
Marcel Alburg
Reproduce code:
---------------
print mktime(0,0,0,0,0,0);
returns 943916400
Expected result:
----------------
mktime(0,0,0,0,0,0) must be 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36401&edit=1