ID: 30215 Updated by: [EMAIL PROTECTED] Reported By: pmurray at nevada dot net dot nz -Status: Feedback +Status: Bogus Bug Type: Date/time related Operating System: Linux 64bit - Opteron PHP Version: 5.*, 4.* Assigned To: derick New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Actually, after debugging this I would consider it as not a bug. What happens is the following: 1. time() returns (something like): 1120069874 2. parsetotime() sees this correctly as "number" 3. the number > 10000 so it applies the following rules: ((struct date_yy *)parm)->yyHaveDate++; ((struct date_yy *)parm)->yyDay= ($1)%100; ((struct date_yy *)parm)->yyMonth= ($1/100)%100; ((struct date_yy *)parm)->yyYear = $1/10000; 4. This turns out to be year 112006, month 98 and day 74. 5. The correct timestamp for this is: 3472662258000 Morale: Don't pass time()'s return value to strtotime() as it might "weird", though correct, behave. Previous Comments: ------------------------------------------------------------------------ [2005-06-29 14:46:58] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip I just tested this on a 64bit platform, it returns bool(false) (like it should): [EMAIL PROTECTED] php5-200506291030]$ sapi/cli/php -r 'var_dump(strtotime(time()));' bool(false) ------------------------------------------------------------------------ [2005-06-27 15:24:22] arpad at zooloo dot com [EMAIL PROTECTED]: I'm not sure if this is related but beta2 on 32bit windows behaves a lot worse than beta1 did: echo strtotime(1118936460); results in 1119871080 which does not make sense. This worked perfectly with beta1. I have not yet tested this on my 64bit gentoo. ------------------------------------------------------------------------ [2005-06-26 01:00:04] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2005-06-18 21:44:15] [EMAIL PROTECTED] I've no access to a 64bit machine. A temporary account would help here - let me know by mail if you can provide one. ------------------------------------------------------------------------ [2005-06-17 00:51:34] pmurray at nevada dot net dot nz Something's changed, but it still doesn't behave properly. [EMAIL PROTECTED]:~/php5-200506162030/sapi/cli> echo "<? print strtotime(time()) . \"\n\"; ?>" | ./php -42492861720 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30215 -- Edit this bug report at http://bugs.php.net/?id=30215&edit=1
