title: Round SQL Time to nearest hour if 1min away from nearest hour
body: <p>I would like to be about to round SQL Time to the nearest hour if the time value is 1min away from the nearest hour. (Time is in 24 hour clock format)</p>
  
  <p>For instance </p>
  
  <pre><code>23:59 - &gt; 00:00
  11:30 - &gt; 11:30
  03:59 - &gt; 04:00
  01:15 - &gt; 01:15
  12:59 - &gt; 13:00
  </code></pre>
  
  <p>This is what I was able to do so far, but it is only rounding to the nearest 1min.</p>
  
  <pre><code>declare @t time 
  declare @t2 time
  set @t = '23:59:00.0000000';
  set @t2 = '23:30:00.0000000';
  
  select cast(dateadd(millisecond, 29999, @t) as smalldatetime) as T1, cast(dateadd(millisecond, 29999, @t2) as smalldatetime) as T2
  </code></pre>