#22814 [Com]: strtotime error
| From: | paulmah at pbi dot com dot sg | Date: | Thu, 13 Nov 2003 09:12:05 +0000 |
| Subject: | #22814 [Com]: strtotime error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-50326@lists.php.net to get a copy of this message | ||
ID: 22814
Comment by: paulmah at pbi dot com dot sg
Reported By: dizit at mail dot ru
Status: No Feedback
Bug Type: Date/time related
Operating System: Windows XP
PHP Version: 4.3.0
Assigned To: hholzgra
New Comment:
I encounter this problem too. On PHP 4.3.2 on Debian Linux, compiled
from source. Running on Apache 1.3.x
strtotime seems to *randomly* return "1".
More details: Our (in-house) accounting application uses strtotime on
MSSQL-returned data. Upon upgrading to 4.3.2, we noticed that there
are random (about 10-20%) instances where strtotime just returns 1. It
cannot be the data problem cause it is not consistent on the same data
set.
Have just switched back to my backup of PHP 4.3.0's libphp4.so and
everything is ok again. Both modules are compiled with the same
configure command.
'./configure' '--with-apxs=/usr/share/apache/bin/apxs'
'--with-regex=php' '--with-config-file-path=/etc/php4/apache'
'--with-sybase=/usr/share/freetds' '--with-zlib' '--with-gd=/usr'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr'
'--with-freetype-dir=/usr'
Previous Comments:
------------------------------------------------------------------------
[2003-08-16 00:56:55] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2003-08-11 16:00:01] hholzgra@php.net
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
can't reproduce this on linux (4.3.2 and head) and XP (4.3.2),
guess it has been fixed somehow since 4.3.0 although i can't identify
the exact change that fixed it ...
and regarding the "last sunday" comment -> this is ignored due to
missing information, you neither told us the date you tried this (ok,
we could guess that from the date you reported) nor did you tell us the
expected and actual result -> bugus for that one ...
------------------------------------------------------------------------
[2003-03-21 13:24:27] hholzgra@php.net
well, in this special case the DST fault
is on the PHP side and not on the users
side IMHO
------------------------------------------------------------------------
[2003-03-21 09:41:37] mgf@php.net
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.
.
------------------------------------------------------------------------
[2003-03-21 08:39:09] dizit at mail dot ru
<?
echo 'Dates 2003-03-29 and 2003-03-30 to
timestamp:<br>'.strtotime('2003-03-29').'<br>'.strtotime('2003-03-30');
echo '<br>and then back with date
function:<p>'.date('Ymd',strtotime('20030329')).'<br>'.date('Ymd',strtotime('20030330')).'<-There
is an error. Must be 2003-03-30';
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22814&edit=1