|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-07-31 02:21 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2019-07-31 02:21 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Description: ------------ I have a problem like this. For a given date I need to get the last day of the previous month. For example today is 2019-07-31, I needed date is 2019-06-30 Test script: --------------- echo date('Y-m-t', strtotime("2019-07-31" . '-1 months')); echo date("Y-m-d", strtotime("-1 Month")); Expected result: ---------------- 2019-07-31 2019-07-01 Actual result: -------------- 2019-06-30 2019-06-01 or 2019-06-30