title: Oracle PLSQL truncate datetime to specific hours
body: <p>I have an Oracle PLSQL code generating a list of datetime stamps and I would like to truncate them to the specific hours of 7am and 7pm rather than the beginning of the day.</p>
  
  <p>For example:</p>
  
  <blockquote>
    <ul>
    <li>01/03/2013 0700   becomes      01/03/2013 0700</li>
    <li>01/03/2013 1235   becomes      01/03/2013 0700</li>
    <li>01/03/2013 1932   becomes      01/03/2013 1900</li>
    <li>02/03/2013 0612   becomes      01/03/2013 1900</li>
    </ul>
  </blockquote>
  
  <p>My code is currently:</p>
  
  <pre><code> SELECT  TRUNC(TRUNC(SYSDATE,'hh') + 1/24 - (ROWNUM) / 24, 'dd')  as shift_date
   FROM widsys.times
   ORDER BY SYSDATE
  </code></pre>
  
  <p>Thanks</p>