title: SQL - Converting datetime format to 12 hours format with hh:mm:ss
body: <p>I have a query like,</p>
  
  <pre><code>SELECT CONVERT(VARCHAR, getdate(), 100) AS TwelveHH
  </code></pre>
  
  <p>output of the above query is <code>Sep 26 2012  6:02PM</code> &amp; i want to get the Hours from the above query means, i will use the query like,</p>
  
  <pre><code>SELECT RIGHT(CONVERT(VARCHAR, getdate(), 100), 7) AS getTime
  </code></pre>
  
  <p>output of the above query is <code>6:02PM</code>.</p>
  
  <p>But, i want output with <strong><em>seconds</em></strong> like <code>6:02:19PM</code> - <code>(hh:mm:ss)</code> format.</p>
  
  <p>How to i get <strong><em>hh:mm:ss</em></strong> format?</p>