These letters are abbreviations of the words in latin am = before meridiem and PM = post meridiem. Meridiem in Spanish means noon. So am in Spanish means before the noon and p.m. means past the noon. Both are written with a dot followed by each letter to indicate that it is an abbreviation.