#28088 [Asn->Csd]: strtotime() cannot convert 00 hours

From: Date: Mon, 20 Jun 2005 07:27:28 +0000
Subject: #28088 [Asn->Csd]: strtotime() cannot convert 00 hours
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80672@lists.php.net to get a copy of this message
ID: 28088 Updated by: derick@php.net Reported By: asif at evoknow dot com -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: Red Hat Linux PHP Version: 4.3.4 Assigned To: derick New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Fixed for PHP 5.1 Previous Comments: ------------------------------------------------------------------------ [2004-08-20 03:40:35] tim at komta dot com BTW, strtotime DOES work with input such as 8/20/2004 00:23, it's only without the colon that it seems to fail. ------------------------------------------------------------------------ [2004-08-20 02:46:16] tim at komta dot com '00' is the designation for midnight as returned by the date() function, as in: date('m/d/Y Hi') For sanity's sake, it really should work. ------------------------------------------------------------------------ [2004-04-21 11:02:01] asif at evoknow dot com Description: ------------ When a string like "04/04/04 0045" is passed to strtotime(), it returns -1. Reproduce code: --------------- echo "The following line rightly shows the correct date time\r\n"; echo date("m/d/y Hi", strtotime("04/04/04 2345")); echo "\r\nBut the following line fails to show the correct date time\r\n"; echo date("m/d/y Hi", strtotime("04/04/04 0045"))."\r\n"; Expected result: ---------------- The following line rightly shows the correct date time 04/04/04 2345 But the following line fails to show the correct date time 04/04/04 0045 Actual result: -------------- The following line rightly shows the correct date time 04/04/04 2345 But the following line fails to show the correct date time 01/01/70 0559 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28088&edit=1

« previous php.bugs (#80672) next »