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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 17:01:28 2024 UTC