php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14282 wrong strtotime calculation with timezones -0100 and +0100
Submitted: 2001-11-29 09:38 UTC Modified: 2001-12-02 06:35 UTC
From: jan at horde dot org Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.1.0 OS: any
Private report: No CVE-ID: None
 [2001-11-29 09:38 UTC] jan at horde dot 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;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-02 02:57 UTC] zak@php.net
Thanks - Fixed in CVS

 [2001-12-02 06:35 UTC] derick@php.net
This was not fixed yet in CVS. It is now however.

Derick
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 29 01:05:44 2022 UTC