|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-06 20:53 UTC] rasmus@php.net
[2010-01-07 01:37 UTC] keefeg at gmail dot com
[2010-01-07 01:53 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 14:00:02 2025 UTC |
Description: ------------ strtotime does not handle the "last month" parameter correctly all the time. Reproduce code: --------------- --- From manual page: function.strtotime#Description --- $ny = strtotime("31 December 2009"); echo "this month: " . date('Ym', strtotime("now", $ny)) . "\n"; echo "last month: " . date('Ym', strtotime("last month", $ny)) . "\n"; Expected result: ---------------- I would like it to produce this result: this month: 200912 last month: 200911 Actual result: -------------- It prints this result: this month: 200912 last month: 200912