title: What is the difference between hh and HH in dateformatting in SQL?
body: <p>When formatting my time i get different results depending on the use of hh or HH.</p>
  
  <p>Can someone tell me why this happens?
  The problem occurs with the following code, returning a NULL on the 2nd result.</p>
  
  <pre><code>declare @TIMEPART time = getdate()
  
  declare @datetime datetime2(7) = getdate()
  
  select format(@timepart, 'hh\:mm'), format(@timepart, 'HH\:mm'), format(@datetime, 'hh\:mm'), format(@datetime, 'HH\:mm')
  </code></pre>