It is commonly known that AM
stands for morning hour and PM
for after and evening hours.

Noon and mid day is the time when
Sun is directly overhead and day and
has been divided in two halves one
before noon, when the Sun is rising
and other afternoon when Sun is setting.

In Latin words used to depict mid day
or noon is meridies, ante means before
post means after.

The hours before the noon are hence
are known as ante meridies hours or
AM and the hours after the noon are
post meridies known as PM.