|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-08-28 01:11 UTC] cmb@php.net
-Type: Bug
+Type: Feature/Change Request
[2015-08-28 01:11 UTC] cmb@php.net
[2018-12-05 14:15 UTC] bjoern dot fischer at dezem dot de
[2021-08-06 17:09 UTC] cmb@php.net
[2022-05-13 10:24 UTC] git@php.net
[2022-05-13 10:24 UTC] git@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 11:00:02 2025 UTC |
Description: ------------ While the constructor of DateTime can handle negaive dates (BC dates), create_date_from_format cannot. Reproduce code: --------------- $d = new DateTime("-4000-01-31"); echo $d->format("Y-m-d"), PHP_EOL; $d = date_create_from_format("Y-m-d", "4000-01-31"); echo $d->format("Y-m-d"), PHP_EOL; $d = date_create_from_format("Y-m-d", "-4000-01-31"); echo $d->format("Y-m-d"), PHP_EOL; Expected result: ---------------- -4000-01-31 4000-01-31 -4000-01-31 Actual result: -------------- -4000-01-31 4000-01-31 PHP Fatal error: Call to a member function format() on a non-object in Command line code on line 3