12:00 AM is one minute before that.
12:00 AM is one minute before that.
Midday and midnight are the points at which AM/PM change and you can't logically differentiate them by appending AM or PM. You just have to know the arbitrary cultural convention that midday is PM.
12:00 and 12:01 are both in the 12:XX hour, but 11:59 and 12:00 are not. Of course the whole thing is arbitrary, but the convention is that the 12:00 - 12:59 hour is PM, rather than just 12:00.
Which is strange, because it does not follow the concept that all other of those time"stamps" do.
12 AM implies that 12 hours of something has passed, but it's nothing that we would align our lives against. And why is 11 AM after 12 AM on the same day? There's no logic (ok, some, but... well... a strange one) behind that.