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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 29 = ?
Subscribe to this entry?

 
 [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: Thu May 02 02:01:28 2024 UTC