
Every day starts precisely at midnight. AM (Ante-Meridiem = before noon) starts just after midnight. PM (Post-Meridiem=after noon) starts just after midday. This means that 12am and 12pm have no meaning.
This diagram shows the cycle of a 24-hour day and the words we use to describe its parts. The day starts at midnight.

To refer to these parts of the day, we use different prepositions:
In the morning. | 6,00 AM – 12,00 PM |
In the afternoon. | 12,00 PM – 6,00 PM |
In the evening. | 6,00 PM – 12,00 AM |
At night. | 12,00 AM – 6,00 AM |