ID: 27217 User updated by: chkp45 at hotmail dot com Reported By: chkp45 at hotmail dot com Status: Open Bug Type: Date/time related Operating System: Linux PHP Version: 4.3.4 New Comment:
Using latest snapshot (200402111030) on linux has no effect. Previous Comments: ------------------------------------------------------------------------ [2004-02-11 05:47:22] chkp45 at hotmail dot com Further testing showed that leading zeroes in dates seems to be the problem. Using CONVERT in my sql statement showed that formats which do not have leading zeroes in dates work perfectly. Funny, though, that May 21 2003 went wrong in run3 ??? ------------------------------------------------------------------------ [2004-02-11 05:12:42] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2004-02-11 04:30:24] chkp45 at hotmail dot com Description: ------------ I read data from mssql server and get dates as "Feb 02 2004 12:00AM". I read several dates in a loop, and for some dates strtotime returns -1 occasionally, seemingly at random. When I refresh, the wrong result changes to another date. $d1 = strtotime($v["date"]); printf("%s %s<br>", $v["date"], $d1); run 1: Feb 02 2004 12:00AM 1075672800 Feb 03 2004 12:00AM -1 Feb 04 2004 12:00AM 1075845600 Feb 05 2004 12:00AM 1075932000 Feb 06 2004 12:00AM 1076018400 Feb 09 2004 12:00AM 1076277600 Feb 10 2004 12:00AM -1 run2: Feb 02 2004 12:00AM -1 Feb 03 2004 12:00AM 1075759200 Feb 04 2004 12:00AM 1075845600 Feb 05 2004 12:00AM 1075932000 Feb 06 2004 12:00AM 1076018400 Feb 09 2004 12:00AM 1076277600 Feb 10 2004 12:00AM 1076364000 run3: May 05 2003 12:00AM 1052082000 May 06 2003 12:00AM -1 May 07 2003 12:00AM 1052254800 May 08 2003 12:00AM 1052341200 May 09 2003 12:00AM 1052427600 May 12 2003 12:00AM 1052686800 May 13 2003 12:00AM 1052773200 May 14 2003 12:00AM 1052859600 May 15 2003 12:00AM 1052946000 May 16 2003 12:00AM 1053032400 May 19 2003 12:00AM 1053291600 May 20 2003 12:00AM 1053378000 May 21 2003 12:00AM 1053464400 May 21 2003 12:00AM -1 May 21 2003 12:00AM -1 May 22 2003 12:00AM 1053550800 May 23 2003 12:00AM 1053637200 May 26 2003 12:00AM 1053896400 May 27 2003 12:00AM 1053982800 May 27 2003 12:00AM 1053982800 May 27 2003 12:00AM 1053982800 May 28 2003 12:00AM 1054069200 May 28 2003 12:00AM 1054069200 May 30 2003 12:00AM 1054242000 May 30 2003 12:00AM 1054242000 This happened when I tested code in Fedora Linux 1, Apache 1.3.29 PHP 4.3.4. Production version works ok on W2K Apache PHP 4.3.3. On W2K date strings don't have leading zeros, eg "Feb 2 2004 12:00AM" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27217&edit=1