#50051 [Fbk->Bgs]: strtotime
| From: | derick@php.net | Date: | Sun, 01 Nov 2009 20:37:56 +0000 |
| Subject: | #50051 [Fbk->Bgs]: strtotime | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144143@lists.php.net to get a copy of this message | ||
ID: 50051
Updated by: derick@php.net
Reported By: tailinchu at gmail dot com
-Status: Feedback
+Status: Bogus
Bug Type: Date/time related
PHP Version: 5.2.11
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
"200910" gets parsed as 20:09:10 and not 2009-10:
derick@kossu:~$ php -r 'var_dump(date_parse("200910"));'
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
int(20)
["minute"]=>
int(9)
["second"]=>
int(10)
["fraction"]=>
float(0)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(0)
["errors"]=>
array(0) {
}
["is_localtime"]=>
bool(false)
}
Previous Comments:
------------------------------------------------------------------------
[2009-11-01 20:35:49] sjoerd@php.net
Strtotime('200910') creates a correct timestamp on today, with a time
of 20:09:10.
------------------------------------------------------------------------
[2009-11-01 20:32:29] sjoerd@php.net
Thank you for your bug report.
The string you supply, 200910, is not a complete date. Why do you think
this should return 2009-10-01?
------------------------------------------------------------------------
[2009-11-01 20:29:16] tailinchu at gmail dot com
Description:
------------
strtotime() cannot create correct timestamp.
Reproduce code:
---------------
echo date('Ymd',strtotime('200910'));
Expected result:
----------------
20091001
Actual result:
--------------
20091101
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50051&edit=1