Or much less elegant if you try hard!!
Code:
=IF(AND(A1=23,B1>30),0,IF(B1>30, A1+1,A1))
Id use cookies code with an addition of if it's 23:34 for example, it'll round it up to '0' rather than '24'. The 1410 is 23*60 minutes, plus the 30 minutes.
Code:
=IF((A1*60)+B1>1410,0,ROUND(((A1*60)+B1)/60,0))
Both work.