|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-26 17:45 UTC] tony2001@php.net
[2005-07-26 17:47 UTC] jeremy at techtrav dot com
[2005-07-26 18:17 UTC] tony2001@php.net
[2005-07-27 00:29 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ the newest snap of php 5.1.X does not parse strtotime properly for adding days. This used to work in 5.0.4. Look at the reproduceable code below. The new version only seems to work with a space between the number and the days or months or years. Reproduce code: --------------- $date = strtotime('20 Aug'); echo date('m/d/Y H:m:s', strtotime('+5days',$date)); echo '<br>'; echo date('m/d/Y H:m:s', strtotime('+1month',$date)); echo '<br>'; echo date('m/d/Y H:m:s', strtotime('+1year',$date)); Expected result: ---------------- 08/25/2005 00:08:00 09/20/2005 00:09:00 08/20/2006 00:08:00 Actual result: -------------- 01/01/1970 00:01:00 01/01/1970 00:01:00 01/01/1970 00:01:00