|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-14 17:36 UTC] dverspui at hotpop dot com
Description:
------------
strtotime("<day>",<time>) returns the specified day of the next week of <time> if <time> itself is on day <day>.
Reproduce code:
---------------
print date("Ymd",strtotime(date("l",time()),time()));
Expected result:
----------------
Output should be the date of today, but on my installation it returns the date of 7 days ahead. This differs from all earlier PHP versions.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 12:00:01 2025 UTC |
Hi Derick, I would agree if it would include "next" like in: print date("Ymd","next " . strtotime(date("l",time()),time())); I think people in many projects have been using my earlier example with all PHP versions prior to 5.1.0 and this breaks their code. E.g. I bumped into this when using PHP iCalender. After all, I cannot seem to find any exact specs on what strtotime should return for my example. The manual nowhere tells me that it will e.g. return next weeks tuesday if the specified time is on a tuesday. It will definitely returns a tuesday, but which one then??