title: EXTRACT() Hour in 24 Hour format
body: <p>I have something like below-</p>
  
  <pre><code>EXTRACT(HOUR from CAST(to_char(tran_datetime,'DD-MON-YYYY HH24:MI:SS') AS TIMESTAMP))
  </code></pre>
  
  <p><code>tran_datetime</code> is <code>DATE</code> type. This gives error for some rows saying <code>HOUR must be between 1 and 12</code>, so I understand that it cannot handle Hour in a <code>24 Hour</code> format (or military time). The below works (obviously)-</p>
  
  <pre><code>EXTRACT(HOUR from CAST(to_char(tran_datetime,'DD-MON-YYYY HH:MI:SS') AS TIMESTAMP)) 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>EXTRACT(HOUR from CAST(tran_datetime AS TIMESTAMP))  --12 Hr format by default
  </code></pre>
  
  <p>Is there a way to use <code>EXTRACT()</code> to get the <code>HOUR</code> in 24 Hour format i.e. 15 for 3 PM, 13 for 1 PM etc.</p>
  
  <p>Please Note- <code>to_char(tran_datetime,'HH24')</code> is a very obvious option, but I am looking to use <code>EXTRACT()</code> function specifically.</p>