|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2014-10-08 04:16 UTC] leigh@php.net
-Status: Open
+Status: Verified
[2014-10-08 04:16 UTC] leigh@php.net
[2014-10-08 05:31 UTC] leigh@php.net
-Status: Verified
+Status: Analyzed
-Assigned To:
+Assigned To: leigh
[2014-10-08 05:31 UTC] leigh@php.net
[2016-11-11 11:41 UTC] derick@php.net
-Status: Analyzed
+Status: Closed
[2016-11-11 11:41 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
Description: ------------ Using setTimestamp after modifying a DateTime object with "first day of this month" string results in the incorrect date and time. If "first day of this month" is replaced with something else like "tomorrow" it works fine. For some reason the example below appears to lock in the date component, but not the time. Test script: --------------- $time_start = new DateTime('2014-10-02'); echo $time_start->format('r') . "\n"; $time_start->modify('first day of this month'); echo $time_start->format('r') . "\n"; $time_start->setTimestamp(time()); echo $time_start->format('r') . "\n"; Expected result: ---------------- Current date and time Actual result: -------------- October 1st