#38537 [Opn->Bgs]: timezone difference between PDO/Sqlite and PHP

From: Date: Mon, 21 Aug 2006 16:21:25 +0000
Subject: #38537 [Opn->Bgs]: timezone difference between PDO/Sqlite and PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-101075@lists.php.net to get a copy of this message
ID: 38537 Updated by: tony2001@php.net Reported By: mad at dactar dot ch -Status: Open +Status: Bogus Bug Type: PDO related Operating System: HP-UX PHP Version: 5.1.5 New Comment: date.timezone sets timezone only for PHP's datetime functions. All third-party libraries are not affected. Previous Comments: ------------------------------------------------------------------------ [2006-08-21 16:09:34] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38537&edit=1

« previous php.bugs (#101075) next »