Q:

Round SQL Time to nearest hour if 1min away from nearest hour

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)
For instance 
23:59 - > 00:00
11:30 - > 11:30
03:59 - > 04:00
01:15 - > 01:15
12:59 - > 13:00

This is what I was able to do so far, but it is only rounding to the nearest 1min.
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

A:

You can make a decision if you try to add one minute and then test the result:
SELECT 
    cast(dateadd(millisecond, 29999, @t) as smalldatetime) as T1, 
    cast(dateadd(millisecond, 29999, @t2) as smalldatetime) as T2
    ,CASE WHEN SUBSTRING(CAST(DATEADD(MINUTE, 1, @t) as nvarchar(15)),4,2) = '00' THEN DATEADD(MINUTE, 1, @t) ELSE @t END
    ,CASE WHEN SUBSTRING(CAST(DATEADD(MINUTE, 1, @t2) as nvarchar(15)),4,2) = '00' THEN DATEADD(MINUTE, 1, @t2) ELSE @t2 END

