|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-01 14:57 UTC] sixd@php.net
[2016-03-08 01:04 UTC] sixd@php.net
-Package: Oracle related
+Package: OCI8 related
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 19:00:01 2025 UTC |
Description: ------------ When you want to select a column from a table whose type is "DATE" then php truncates the value so that you only get the day but not the time from it that mean no hours, no minutes and no seconds. Reproduce code: --------------- $query="select datefield from sometable"; $conn = oci_connect("user", "pass", "//dbserver:1521/HVSQP0"); $stmt = oci_parse($conn, $query); oci_execute($stmt); while ($result = oci_fetch_row($stmt)) { print_r($result); print "<br>\n"; } ... Expected result: ---------------- Something like 01.08.2007 13:45:28 Actual result: -------------- you get only 01.08.2007. The only workaround i found so far is to change the query to "select TO_CHAR(datefield,'DD.MM.YYYY HH24:MI:SS') from sometable". Then you get what you expect.