Code for AM times

if AM is the value of amPM, then format the times correctly using the
if/else statements inside