Good day. There is an Oracle database, there is a table in it, one of the columns is in date format. In php I cling to the table and select from it info.

$conn = oci_connect("xxx", "xxx", "xxx"); $query_1 = "select max (p.navi_date), p.navi_user from payments p where p.pay_date >= trunc(sysdate) and p.navi_user = 'HAS:WWW:PARDOXT' group by p.navi_user order by 1"; $s_1 = oci_parse($conn, $query_1); oci_execute($s_1); oci_fetch_all($s_1, $arr_1); $o_1 = $arr_1['MAX(P.NAVI_DATE)']; echo($o_1[0]); 

as a result, a date is given on the page in a format 06/11/15 How to make its format be 06/11/15 2:31:16 PM?

    2 answers 2

    DATE columns are returned as strings formatted to the current date format. ALTER SESSION SET NLS_DATE_FORMAT command.

    Example # 8 oci_fetch_array () with DATE columns

    Or explicitly via to_char(max(...), 'dd.mm.yy hh24:mi:ss') .

      echo date('dmy H:i:s', strtotime($o_1[0]));

      • 06/11/15 11:06:15 - Shows dubbing of the date, but I need time. - Muhammad Yakubov