There are no official standards established for the meaning of 12am and 12pm, but it is generally accepted that 12am means midnight and 12pm means midday. The ‘am’ and ‘pm’ stand for ante meridiem and post meridiem – Latin words meaning ‘before the middle of the day’ and ‘after the middle of the day’.
When the clock hits 12:00:00, you have hit ‘meridiem’. So all times before that are ‘ante meridiem’ within the same day, and all times afterwards are ‘post meridiem’, up until the clock hits midnight and a new day begins.
By the time you have seen a clock showing 12:00 at midday it is already post meridiem, and similarly at midnight it is already ante meridiem.