Bug #14282: wrong strtotime calculation with timezones -0100 and +0100
| From: | jan at horde dot org | Date: | Thu, 29 Nov 2001 14:38:54 +0000 |
| Subject: | Bug #14282: wrong strtotime calculation with timezones -0100 and +0100 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-72019@lists.php.net to get a copy of this message | ||
From: jan@horde.org
Operating system: any
PHP version: 4.1.0
PHP Bug Type: Date/time related
Bug description: wrong strtotime calculation with timezones -0100 and +0100
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 bug report at: http://bugs.php.net/?id=14282&edit=1