This has been buggin me for a long time (haha). There ain't no such time as 12 a.m. or 12 p.m. a.m. is an abbreviation for the Latin ante meridiam meaning before midday which is noon. p.m. is an abbreviation for post meridiam which is Latin for after midday. Midnight separates the start of the ante meridiam from the end of the post meridiam.
Don't they teach kids how to tell time in school?
Repeat after me
When it is light outside it is 12 noon.
When it is dark outside it is 12 midnight.