|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69529 strtotime fix
Submitted: 2015-04-24 21:34 UTC Modified: 2015-04-24 22:23 UTC
From: serella_c at hotmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: serella_c at hotmail dot com
New email:
PHP Version: OS:


 [2015-04-24 21:34 UTC] serella_c at hotmail dot com
From manual page:

Im wondering if there is ever going to be a fix for what i consider to be a bug.

It wouldnt be acceptable to iterate over an array and when asking for next and last the result being best guessed so i dont see why this is any different.

We should not have to resort to calling strtotime with a date in the middle of the month then adjust the date required thats just a hack and this has been a known issue for several years, its time to fix strtotime.

Expected result:
strtotime should return what is asked of it.

If i ask for last month it should return last month regardless of the day in the month be it the 31st, 15th or 1st the result should be the same. across the board.

Likewise for next month, years etc. It is quite clear that when asking for next or last of something we really do mean the next or last regardless of day numbers involved.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-24 22:07 UTC]
-Status: Open +Status: Wont fix
 [2015-04-24 22:07 UTC]
For better or worse there are two approaches to date math like this. PHP conforms to the normal UNIX approach as exhibited by your command line GNU date command, sqlite and several other tools. Whether or not this is the best approach has been argued back and forth for a decade, but it certainly isn't a bug and we are not going to suddenly swap it to the other approach.

You can read more here:
and here:
 [2015-04-24 22:23 UTC]
-Package: *General Issues +Package: Date/time related
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 10:01:26 2023 UTC