#34676 [Asn]: missing support for strtotime("midnight") and strtotime("noon")
| From: | derick@php.net | Date: | Sat, 08 Oct 2005 13:45:48 +0000 |
| Subject: | #34676 [Asn]: missing support for strtotime("midnight") and strtotime("noon") | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86249@lists.php.net to get a copy of this message | ||
ID: 34676
Updated by: derick@php.net
Reported By: rajiv at alum dot mit dot edu
Status: Assigned
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5CVS, 4CVS (2005-09-29)
Assigned To: derick
New Comment:
I can implement this, but I do not agree that "noon" should go to the
next day if it's already in the afternoon here. IMO that doesn't make
any sense. Also, I'm not totally sure why "noon" and "midnight" are
better than "00:00" and "12:00"...
Previous Comments:
------------------------------------------------------------------------
[2005-09-29 09:11:25] sniper@php.net
Reclassified as feature request and assigned to Derick so he can add in
PHP 5.1.x. :)
------------------------------------------------------------------------
[2005-09-29 06:20:04] rajiv at alum dot mit dot edu
Description:
------------
strtotime() should be able to parse "midnight" and "noon".
Reproduce code:
---------------
echo strtotime("midnight");
echo strtotime("noon");
Expected result:
----------------
echo strtotime("midnight");
should print the time stamp for the next midnight
(midnight tomorrow).
echo strtotime("noon");
should print the time stamp for the next noon
(noon today/tomorrow depending on the current time).
echo strtotime("12:00 am");
echo strtotime("12 am");
echo strtotime("12:00 pm");
echo strtotime("12 pm");
all do the correct things.
Actual result:
--------------
echo strtotime("midnight");
returns -1.
echo strtotime("noon");
returns -1.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34676&edit=1