ID: 50051 User updated by: tailinchu at gmail dot com Reported By: tailinchu at gmail dot com Status: Bogus Bug Type: Date/time related PHP Version: 5.2.11 New Comment:
Thanks. Previous Comments: ------------------------------------------------------------------------ [2009-11-01 20:37:56] [email protected] 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: der...@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) } ------------------------------------------------------------------------ [2009-11-01 20:35:49] [email protected] Strtotime('200910') creates a correct timestamp on today, with a time of 20:09:10. ------------------------------------------------------------------------ [2009-11-01 20:32:29] [email protected] 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
