From:
Operating system: RHEL 5 - linux
PHP version: 5.2.13
Package: PDO related
Bug Type: Bug
Bug description:date format
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 bug report at http://bugs.php.net/bug.php?id=51863&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51863&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51863&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51863&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51863&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51863&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51863&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51863&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51863&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51863&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51863&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51863&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51863&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51863&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51863&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51863&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51863&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51863&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51863&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51863&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51863&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51863&r=mysqlcfg