title: Oracle: How to convert the following date to a different format:
body: <p>in my select query i have the following</p>
  
  <pre><code>substr(to_date(NEXT_ARRIVAL_DATE, 'yyyy-mm-dd'), 0, 10)
  </code></pre>
  
  <p>Which yields:</p>
  
  <pre><code>08-JUN-11
  </code></pre>
  
  <p>What i need is it to yield:</p>
  
  <p><code>2011-06-08</code></p>
  
  <p>EDIT: 
  The data was coming in wrong. sorry. The below workds fine</p>
  
  <pre><code>to_char(to_date(NEXT_ARRIVAL_DATE, 'mm/dd/yyyy'), 'YYYY-MM-DD') ||  ' 00:000:00'
  </code></pre>