Are noon and midnight 12 a.m. or 12 p.m.?
This is a tricky question. The answer is that the terms 12 a.m. and 12 p.m. are wrong and should not be used.
To illustrate this, consider that "a.m" and "p.m." are abbreviations for "ante meridiem" and "post meridiem." They mean "before noon" and "after noon," respectively. Noon is neither before or after noon; it is simply noon. Therefore, neither the "a.m." nor "p.m." designation is correct. On the other hand, midnight is both 12 hours before noon and 12 hours after noon. Therefore, either 12 a.m. or 12 p.m. could work as a designation for midnight, but both would be ambiguous as to the date intended.
When a specific date is important, and when we can use a 24-hour clock, we prefer to designate that moment not as 1200 midnight, but rather as 0000 if we are referring to the beginning of a given day (or date), or 2400 if we are designating the end of a given day (or date).
To be certain of avoiding ambiguity (while still using a 12-hour clock), specify an event as beginning at 1201 a.m. or ending at 1159 p.m., for example; this method is used by the railroads and airlines for schedules, and is often found on legal papers such as contracts and insurance policies.
If one is referring not to a specific date, but rather to several days, or days in general, use the terms noon and midnight instead of 12 a.m. and 12 p.m. For example, a bank might be open on Saturdays from 8 a.m. to noon. Or a grocery store might be open daily until midnight. The terms "12 noon" and "12 midnight" are also correct, though redundant