#18769 [Opn->Bgs]: strtotime('00:01am'); returns -1 instead of timestamp
| From: | eru@php.net | Date: | Wed, 07 Aug 2002 08:18:17 +0000 |
| Subject: | #18769 [Opn->Bgs]: strtotime('00:01am'); returns -1 instead of timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16123@lists.php.net to get a copy of this message | ||
ID: 18769
Updated by: eru@php.net
Reported By: peka@yashuu.de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Tested on Windows2000 / Unix
PHP Version: 4.2.2
New Comment:
This is quite correct, as 0 isn't a valid hour in this time-format. To
quote from date input formats:
If the time is followed by
am' or pm' (or a.m.' or
p.m.'), hour is
restricted to run from 1 to 12, and `:minute' may be omitted (taken to
be zero). am' indicates the first half of the day, pm' indicates the
second half of the day. In this notation, 12 is the predecessor of 1:
midnight is 12am' while noon is 12pm'.
See http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html
Previous Comments:
------------------------------------------------------------------------
[2002-08-07 04:01:10] peka@yashuu.de
The PHP code
<?
echo strtotime('00:01am');
?>
produces -1 as return instead of a correct timestamp
I tested on W2k/Apache/PHP 4.2.2, afterwards uploading it to my
webspace provider who uses Unix. The bug is reproduceable there, too.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18769&edit=1