title: How do I convert a JDBC:Oracle Date into a DateTime for Ruby?
body: <p>I finally figured it out how to connect my Sinatra app via JDBC and Sequel to an existing Oracle database.</p>
  
  <p>Now my problem is that I would like to show the Date fields from the Oracle DB as Date with time.</p>
  
  <p>Quick date definition from Oracle:</p>
  
  <blockquote>
    <p>Valid date range from January 1, 4712
    BC to December 31, 9999 AD. The
    default format is determined
    explicitly by the NLS_DATE_FORMAT
    parameter or implicitly by the
    NLS_TERRITORY parameter. The size is
    fixed at 7 bytes. This datatype
    contains the datetime fields YEAR,
    MONTH, DAY, <strong>HOUR, MINUTE, and SECOND</strong>.
    It does not have fractional seconds or
    a time zone.</p>
  </blockquote>
  
  <p>In Ruby I would like to do this:</p>
  
  <pre><code>row_added.strftime('%d.%B %Y %H:%M:%S') =&gt; 09.May 2011 00:00:00
  </code></pre>
  
  <p>But a Ruby Date does not have hours or minutes.</p>
  
  <p>Instead I have to do this at the SQL level to see the time:</p>
  
  <pre><code>to_char(row_added, 'DD.MM.YY HH24:MI:ss') =&gt; 09.05.11 08:33:31
  </code></pre>
  
  <p>It is working as expected, but should not be the best solution for this.</p>
  
  <p>Can anyone tell me how I can get Ruby Sequel to convert this to a Time or DateTime value and not Date?</p>