How to format API date/time format on page

I am unsure how to implement the code
You provided. I am trying to change the format of the date in the. “Repeater” from. “Yyyy-mm-dd HH:mm:ss” to “mm-dd-yyyy hh:mm am/pm.

The date is being imported from the api that is set up on the backend.