|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-30 20:53 UTC] jbarrett at australink dot net
when running
<?PHP
print date("d/m/Y", strtotime("31 July 2001"))."\n";
print date("d/m/Y", strtotime("-1 month", strtotime("31 July 2001")))."\n";
?>
it replies with
X-Powered-By: PHP/4.0.3pl1
Content-type: text/html
31/07/2001
01/07/2001
of course what it's doing is turning it into 31 june which is then being considered to be the 1 of july.. Should this be right or should strtotime realise that there are 30 days in june and truncate the "31st" day?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 15:00:02 2025 UTC |
Confirmed with php 4.2.0-dev. print date("d/m/Y", strtotime("1 month ago", strtotime("31 July 2001")))."\n"; Gives the same error, and that should be correct GNU date syntax? R.