Bug #14282 Updated: wrong strtotime calculation with timezones -0100 and +0100

From: Date: Sun, 02 Dec 2001 07:57:16 +0000
Subject: Bug #14282 Updated: wrong strtotime calculation with timezones -0100 and +0100
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-72250@lists.php.net to get a copy of this message
ID: 14282
Updated by: zak
Reported By: jan@horde.org
Old Status: Open
Status: Closed
Bug Type: Date/time related
Operating System: any
PHP Version: 4.1.0
New Comment:

Thanks - Fixed in CVS


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

[2001-11-29 09:38:54] jan@horde.org

This code:
<?php

$now = date('r');
$stamp = strtotime($now);
$conv = date('r', $stamp);

echo "$now\n$conv";

?>

produces this output:
Thu, 29 Nov 2001 15:24:21 +0100
Sun, 25 Nov 2001 12:24:21 +0100

This is the fix:
--- parsedate.y~        Thu Nov 15 15:33:41 2001
+++ parsedate.y Thu Nov 29 15:28:52 2001
@@ -255,7 +255,7 @@
            yySeconds = $5;
            yyMeridian = MER24;
            yyHaveZone++;
-               if ($6 < -100 || $6 > 100) {
+               if ($6 <= -100 || $6 >= 100) {
                        yyTimezone =  -$6 % 100 + (-$6 / 100) * 60;
                } else {
                        yyTimezone =  -$6 * 60;

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



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



Thread (4 messages)

« previous php.dev (#72250) next »