Req #69529 [Opn->Wfx]: strtotime fix

From: Date: Fri, 24 Apr 2015 22:07:20 +0000
Subject: Req #69529 [Opn->Wfx]: strtotime fix
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192334@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69529&edit=1 ID: 69529 Updated by: rasmus@php.net Reported by: serella_c at hotmail dot com Summary: strtotime fix -Status: Open +Status: Wont fix Type: Feature/Change Request Package: *General Issues Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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: http://www.gnu.org/software/tar/manual/html_node/Relative-items-in-date-strings.html#SEC120 and here: http://www.sqlite.org/lang_datefunc.html Previous Comments: ------------------------------------------------------------------------ [2015-04-24 21:34:54] serella_c at hotmail dot com Description: ------------ --- From manual page: http://www.php.net/function.strtotime --- 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69529&edit=1

« previous php.bugs (#192334) next »