I think it is simpler to remember anything up to noon(1200) is the hour like you said and if it isn’t a double digit like 8 AM you put a zero in front of it like 0800 and 0817 would be 8:17 AM.
Then after noon is when it gets tricky for most so lets say it is 1730….take 17 and subtract 12 you get 5 so 1730 = 5:30 PM
I used that method until it became second nature to me. All the hours 1300, 1400, up to 2300 and 2400(midnight) work if you subtract 12 🙂