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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jan at horde dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 14:01:30 2024 UTC