Convert time to text in Excel and Google Sheets

=TEXT(A2,"hh:mm:ss AM/PM")

A2 = data cell

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.