Req #40269 [Opn->Nab]: date_parse handles 0000-00-00 as 2000-00-00
Edit report at https://bugs.php.net/bug.php?id=40269&edit=1
ID: 40269
Updated by: derick@php.net
Reported by: cleo at anarki dot dk
Summary: date_parse handles 0000-00-00 as 2000-00-00
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Date/time related
Operating System: WindowsXP
PHP Version: 5.2.0
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
This works fine in 5.2.18, 5.3.22, 5.4.x and 5.5.x.
Previous Comments:
------------------------------------------------------------------------
[2007-01-29 08:53:55] cleo at anarki dot dk
Description:
------------
MySQL uses the questionable format '0000-00-00' for a date that has not been set. A kind
of null value for at date.
I fed this date into date_parse(), and got rather an unexpected result: It returns year 2000.
Reproduce code:
---------------
$d= '0000-00-00';
print_r (date_parse($d)) ;
Expected result:
----------------
Array ( [year] => 0000 [month] => 0 [day] => 0 ...
or false or null or an error of some kind.
Actual result:
--------------
Array ( [year] => 2000 [month] => 0 [day] => 0 ...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=40269&edit=1
Thread (2 messages)