|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-08-03 03:09 UTC] vb2005xu at qq dot com
[2015-08-03 03:23 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2015-08-03 03:23 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
Description: ------------ <?php date_default_timezone_set('Asia/Shanghai'); $tn = strtotime("2015-07-31"); echo date('Y-m' , strtotime("-1 month",$tn)); // why output 2015-07 ? Test script: --------------- <?php date_default_timezone_set('Asia/Shanghai'); $tn = strtotime("2015-07-31"); echo date('Y-m' , strtotime("-1 month",$tn)); Expected result: ---------------- 2015-06 Actual result: -------------- 2015-07