title: How to change default date format in Oracle DB with trunc?
body: <p>I have two separate databases. </p>
  
  <p>When I run a query on 1st db:</p>
  
  <pre><code>select
        TO_DATE( sysdate , 'YY-MM-DD')- 1 / 86400 data1,
        trunc(sysdate, 'dd') data2,
        to_char( sysdate, 'YYYY-MM-DD') date3
  from dual
  </code></pre>
  
  <p>it returns this result: </p>
  
  <pre><code>    [data1] =&gt; 14/07/02
      [data2] =&gt; 14/07/02
      [date3] =&gt; 2014-07-02
  </code></pre>
  
  <p>When I run this same query on 2nd db:</p>
  
  <pre><code>select
        TO_DATE( sysdate , 'YY-MM-DD')- 1 / 86400 data1,
        trunc(sysdate, 'dd') data2,
        to_char( sysdate, 'YYYY-MM-DD') date3
  from dual
  </code></pre>
  
  <p>returns me results like below</p>
  
  <pre><code>    [data1] =&gt; 14-JUL-02
      [data2] =&gt; 02-JUL-14
      [date3] =&gt; 2014-07-02
  </code></pre>
  
  <p>How I can change response from DB2 with OCI to return date format like DB1?</p>
  
  <p>Connection string to DB1</p>
  
  <pre><code>try
  {
      $pdo = new PDO('oci:dbname='.User::db1()-&gt;hostfullspec, User::db1()-&gt;login, User::db1()-&gt;passwd);
      $pdo -&gt;setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER);
      $pdo -&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  } catch (PDOException $e) {
       die("ORA RAP: PDO CONNECTION ERROR: " . $e-&gt;getMessage() ).PHP_EOL;
  }
  </code></pre>
  
  <p>Connection string to DB2</p>
  
  <pre><code>try
  {
      $pdo = new PDO('oci:dbname='.User::db2()-&gt;hostfullspec, User::db2()-&gt;login, User::db2()-&gt;passwd);
      $pdo -&gt;setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER);
      $pdo -&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  } catch (PDOException $e) {
       die("ORA RAP: PDO CONNECTION ERROR: " . $e-&gt;getMessage() . "&lt;br/&gt;");
  }
  </code></pre>