The abbreviation a.m. refers to the hours from midnight to noon, and p.m. refers to the hours from noon to midnight. Careful writers avoid such redundancies as three a.m. in the morning (delete in the morning) or eight p.m. this evening (make it eight o'clock this evening).
To avoid confusion, use midnight instead of twelve a.m. and noon instead of twelve p.m.
The terms also are frequently written as A.M., P.M.; AM, PM; and am, pm.