ID: 14676
Updated by: derick
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Date/time related
Operating System: win
PHP Version: 4.1.0
New Comment:

Already fixed, and this will be in the maintenance release 4.1.1, which is due in a 
few days.

Derick

Previous Comments:
------------------------------------------------------------------------

[2001-12-23 17:02:48] [EMAIL PROTECTED]

Suppose your machine is GMT+1. 

When date('r') returns also GMT+1, strtotime()
shows a bug.

<?
$stamp= "Thu, 20 Dec 2001 09:49:52 +0100";
$stamp= strtotime($stamp);
echo "$stamp = " . date("r", $stamp);                 
//Shows: 1008481792 = Sun, 16 Dec 2001 06:49:52 +0100
?>

To give you an idea of the solution, I use the 
following code to get correct results:

<?
$stamp= "20 Dec 2001 09:49:52 +0100";
// beg patch-line 
if( strpos($stamp, date('O')))$stamp= substr($stamp,0,-6);
// end patch-line 
$stamp= strtotime($stamp);
echo "$stamp = " . date("r", $stamp);                 
//Shows: 1008838192 = Thu, 20 Dec 2001 09:49:52 +0100
?>

There is no problem when GMT date('r') 
is different from GMT as returned by date('O')

Regards, IRMaturana


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14676&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to