php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13789 strtotime wrong interpretation of GMT dates
Submitted: 2001-10-22 14:44 UTC Modified: 2001-10-27 13:47 UTC
From: cox at idecnet dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cox at idecnet dot com
New email:
PHP Version: OS:

 

 [2001-10-22 14:44 UTC] cox at idecnet dot com
<?php
// format got from a PostgreSQL datetime column type
$date = '2001-10-22 21:19:58+02';
$stamp = strtotime($date);
$conv = date('d/m/Y H:i:s', $stamp);
echo "$date\n$conv\n";
?>

Output:
2001-10-22 21:19:58+02
22/10/2001 23:17:58

It is adding 2 hours and substracting 2 minutes in all the cases (tested with more $date values).

Tomas V.V.Cox

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-27 13:47 UTC] derick@php.net
Fixed in CVS

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 03:01:27 2024 UTC