php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38537 timezone difference between PDO/Sqlite and PHP
Submitted: 2006-08-21 16:09 UTC Modified: 2006-08-21 16:21 UTC
From: mad at dactar dot ch Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.5 OS: HP-UX
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: mad at dactar dot ch
New email:
PHP Version: OS:

 

 [2006-08-21 16:09 UTC] mad at dactar dot ch
Description:
------------
The date.timezone option defined in php.ini has no effect on PDO/Sqlite.

date.timezone = Europe/Zurich

Reproduce code:
---------------
<?
        echo "<pre>";
        echo '       PHP : ' . date("Y-m-j G:i:s");
        date("D M j G:i:s T Y");
        echo "<BR>";

        echo '      UNIX : ';
        passthru("date '+%Y-%m-%d %H:%M:%S'");
        echo "<BR>";

        echo 'PDO/Sqlite : ';
        $db = new PDO("sqlite::memory:");
        $query="select datetime('now')";
        $row = $db->query($query);
        $result=$row->fetch(PDO::FETCH_NUM);
        echo $result[0];
?>

Expected result:
----------------
       PHP : 2006-08-21 17:49:24      
      UNIX : 2006-08-21 17:49:24
PDO/Sqlite : 2006-08-21 17:49:24


Actual result:
--------------
       PHP : 2006-08-21 17:49:24      
      UNIX : 2006-08-21 17:49:24
PDO/Sqlite : 2006-08-21 15:49:24


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-21 16:21 UTC] tony2001@php.net
date.timezone sets timezone only for PHP's datetime functions.
All third-party libraries are not affected.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 10:01:29 2025 UTC