Style guides variously have all of the possible options!
AM PM
AM PM in small caps
am pm
A.M. P.M.
A.M. P.M. in small caps
a.m. p.m.
AD CE BC BCE have less variations (small caps is common, the . usage rare and lower case very rare)
The am and pm is pretty common in British English, usually with a space (perhaps a small space in print).
Consistency is important.
|