From several sources, including english.stackexchange.com, one should write 3 p.m. instead of 3 PM.
How did the all-capitals variant appear, and especially why? Is it because with typewriters and in terminals, PM uses half as much space than a.m.?