|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-09-27 10:06 UTC] cataphract@php.net
-Package: *Data Exchange functions
+Package: Date/time related
[2011-11-21 17:15 UTC] danielc@php.net
[2011-11-21 17:15 UTC] danielc@php.net
-Status: Open
+Status: Bogus
-Assigned To:
+Assigned To: danielc
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ I often use strtotime, I won't change my program anywhere. +1 month -1 month maybe as expected Test script: --------------- date("Y-m-d H:i:s", strtotime("-1 month", strtotime("2011-05-31 00:00:00"))); //2011-05-01 as expected //2011-04-30 I Like date("Y-m-d H:i:s", strtotime("+1 month", strtotime("2011-05-31 00:00:00"))); //2011-07-01 as expected //2011-06-30 I Like date("Y-m-d H:i:s", strtotime("-1 month", strtotime("2011-03-31 00:00:00"))); //2011-03-03 as expected //2011-02-28 I Like