Mantis - Quercus
Viewing Issue Advanced Details
4064 minor always 06-02-10 03:34 12-20-10 10:34
hm2k  
 
normal  
new 4.0.7  
open  
none    
none  
0004064: strtodate does not work correctly
<?php

echo date('d-M-Y',strtotime('2009/07/14'));
//expected 14-Jul-2009, gave 07-May-2014

echo date('d-M-Y',strtotime('14-Aug-2009'));
//expected 14-Aug-2009, gave 30-Jan-2016

?>
@see http://php.net/strtotime [^]
@see http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime.phpt?view=co [^]
@see http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime_basic.phpt?view=co [^]
@see http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime_basic2.phpt?view=co [^]
@see http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime2.phpt?view=co [^]
@see http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/strtotime3.phpt?view=co [^]

Notes
(0004627)
sblommers   
06-02-10 05:36   
Hi, this was already reported and fixed in version 4.0.8 but is not yet released. It is in SVN and I tested it and it works. (see forum).
(0004629)
hm2k   
06-02-10 12:36   
I was unable to locate this on the forums.

I had tried to report it on the forums, but it never appeared.
(0004632)
sblommers   
06-04-10 06:21   
This bug is *NOT* fixed, I was confused with another bug sorry.
(0004884)
gbruins   
12-20-10 10:34   
Requesting that the severity of this issue be raised to "Major", as I think strtotime() is a commonly used PHP function.

strtotime("today") returns the same value as strtotime("now"), which is not correct.

Also, passing a date in ISO-8601 format is really broken. Here are some code examples:


Quercus (resin 4.0.10) results:
================================
echo strtotime("2010-11-30T23:59:59.000-08:00");
echo("\n");
echo strtotime("today");
echo("\n");
echo strtotime("now");

Displays:
5647337791081199
1292869801
1292869801


Expected results:
============================
1291190399
1292832000
1292869801