Bug #51863 [Fbk->Opn]: date format
| From: | corey dot barnes at verizon dot com | Date: | Thu, 20 May 2010 13:17:54 +0000 |
| Subject: | Bug #51863 [Fbk->Opn]: date format | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150667@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51863&edit=1
ID: 51863
User updated by: corey dot barnes at verizon dot com
Reported by: corey dot barnes at verizon dot com
Summary: date format
-Status: Feedback
+Status: Open
Type: Bug
Package: PDO related
Operating System: RHEL 5 - linux
-PHP Version: 5.2.13
+PHP Version: 5.1.6
New Comment:
This is not dependent on a server setting. I can query using IFX
functions (for INFORMIX) and the date is returned in the correct format,
but when I use the PDO functions it returns as yyyy-mm-dd (instead of
mm/dd/yyyy).
Previous Comments:
------------------------------------------------------------------------
[2010-05-20 14:10:35] mike@php.net
Hi, is this by any chance dependent on your locale, or on a date output
format setting of the server?
------------------------------------------------------------------------
[2010-05-19 22:52:45] corey dot barnes at verizon dot com
Description:
------------
When using the PDO connection option to an Informix data base the date
is returned in the format YYYY-MM-DD instead of in the format that it is
stored in the database.
Test script:
---------------
try {
$pdo=new PDO('informix:host=$host; database=$db; server=$server;
protocol=onsoctcp;',"","",array(PDO::ATTR_PERSISTENT=>true));
} catch (PDOexception $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
$sql = "SELECT dba_date,due_date FROM work_requests Where
work_id='6862105'";
$q = $pdo->prepare($sql);
$q->execute();
$q->setFetchMode(PDO::FETCH_BOTH);
while($sqlr = $q->fetch()){
print $sqlr['DBA_DATE'] ."<br>";
print $sqlr['DUE_DATE'] ."<br>";
}
Expected result:
----------------
mm/dd/yyyy
Actual result:
--------------
yyyy-mm-dd
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51863&edit=1