From 0000 to 0059, add 12 to hours, then AM:
From 0100 to 11:59, just add AM:
From 1200 to 1259, just add AM::
From 1300 to 2359, subtract 12 from the hours, then add PM:
In military time hours are always "hundred", never "thousand", so
12:00 AM = 0000 = midnight; 1200 PM = 1200 = noon.
In the military time notation, the day begins at midnight, 0000. The notation 2400 serves to refer to the end of a day. Physically, 2400 of one day is the same time as 0000 of the following day.