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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 00:01:29 2024 UTC