|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-29 16:24 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
Description: ------------ Subtracting a month using strtotime does not always subtract a month. Reproduce code: --------------- <?php print date('Y-m-d', strtotime('-1 month')); ?> Expected result: ---------------- Assuming the code is run on 2006-03-29, I would expect the result to be 2006-02-28, which is one month ago. Actual result: -------------- 2006-03-01 This is not one month ago. This has been reported as a bug before but marked as "Bogus" - no idea how not subtracting one month from a date correctly is bogus... and I wasn't allowed to add this to the notes system in the manual to warn others about this odd behaviour., so here it is again as a bug report.