This is really a PHP issue. Your first one is using:
<?= date("Y-m-d h:i:s A", strtotime($ticket_row_message['date_added'])); ?>
Your second one is using:
<?= date("Y-m-d h:i:s", strtotime($ticket_row_message['date_added'])); ?>
Just add the "A" to the second one too.