title: Changing date format for PostgreSQL query result
body: <p>I have following query </p>
  
  <pre><code>select substring(listDate from '............$') as v_end_date,
  substring(listDate from '^...............') as v_start_date
  </code></pre>
  
  <p>Now listDate value can be like </p>
  
  <pre><code>select substring('06 Jan 2014 to 12 Jan 2014,
   13 Jan 2014 to 19 Jan 2014,
   20 Jan 2014 to 26 Jan 2014
  ' from '............$') as v_end_date,
  substring('06 Jan 2014 to 12 Jan 2014,
   13 Jan 2014 to 19 Jan 2014,
   20 Jan 2014 to 26 Jan 2014
  ' from '^............') as v_start_date
  </code></pre>
  
  <p>Above query results in </p>
  
  <pre><code>V_END_DATE  V_START_DATE
  26 Jan 2014 06 Jan 2014
  </code></pre>
  
  <p>Now I need to have <code>v_end_date</code> and <code>v_start_date</code> format like <code>yyyy-mm-dd</code> and like 
  <code>Mon 06 Jan 2014</code>.</p>