What Time It Is?
"AM" stands for the Latin phrase Ante Meridiem -- which means "before noon" -- and "PM" stands for Post Meridiem : "after noon."
Although digital clocks routinely label noon "12:00 PM" you should avoid this expression not only because it is incorrect, but because many people will imagine you are talking about midnight instead. The same goes for "12:00 AM." Just say or write "noon" or "midnight" when you mean those precise times.
It is now rare to see periods placed after these abbreviations: "A.M." , but in formal writing it is still preferable to capitalize them, though the lower-case "am" and "pm" are now so popular they are not likely to get you into trouble.
Occasionally computer programs encourage you to write "AM" and "PM" without a space before them, but others will misread your data if you omit the space. The nonstandard habit of omitting the space is spreading rapidly, and should be avoided in formal writing.