|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-02-12 17:55 UTC] derick@php.net
[2017-02-12 20:20 UTC] derick@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: derick
[2017-02-12 20:20 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ When you run the test script, the second outpot is parsed false. It returns the date minus one day. Maybe this error occures with other strings also. Test script: --------------- <?php $dt = new DateTime('-1999-06-22 00:00:00'); echo "\nThis should be -1999-06-22 00:00:00 -> " . $dt->format('Y-m-d H:i:s'); $dt = new DateTime('-1916-06-22 00:00:00'); echo "\nThis should be -1916-06-22 00:00:00 -> " . $dt->format('Y-m-d H:i:s'); Expected result: ---------------- This should be -1999-06-22 00:00:00 -> -1999-06-22 00:00:00 This should be -1916-06-22 00:00:00 -> -1916-06-22 00:00:00 Actual result: -------------- This should be -1999-06-22 00:00:00 -> -1999-06-22 00:00:00 This should be -1916-06-22 00:00:00 -> -1916-06-21 00:00:00