ID: 37514 Updated by: [EMAIL PROTECTED] Reported By: pcavit at gmail dot com -Status: Open +Status: Assigned Bug Type: Date/time related Operating System: FreeBSD 6 PHP Version: 5.1.4 -Assigned To: +Assigned To: derick
Previous Comments: ------------------------------------------------------------------------ [2006-05-18 22:43:03] pcavit at gmail dot com Description: ------------ When using strtotime to parse dates if an 'am' or 'pm' is added without specifying a year false will be returned. Reproduce code: --------------- echo date('r', strtotime('May 18th 5:05')); echo date('r', strtotime('May 18th 5:05pm')); echo date('r', strtotime('May 18th 5:05 pm')); echo date('r', strtotime('May 18th 5:05am')); echo date('r', strtotime('May 18th 5:05 am')); echo date('r', strtotime('May 18th 2006 5:05pm')); Expected result: ---------------- Thu, 18 May 2006 05:05:00 -0700 Thu, 18 May 2006 17:05:00 -0700 Thu, 18 May 2006 17:05:00 -0700 Thu, 18 May 2006 05:05:00 -0700 Thu, 18 May 2006 05:05:00 -0700 Thu, 18 May 2006 17:05:00 -0700 Actual result: -------------- Thu, 18 May 2006 05:05:00 -0700 Wed, 31 Dec 1969 16:00:00 -0800 Wed, 31 Dec 1969 16:00:00 -0800 Wed, 31 Dec 1969 16:00:00 -0800 Wed, 31 Dec 1969 16:00:00 -0800 Thu, 18 May 2006 17:05:00 -0700 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37514&edit=1