How to format API date/time format on page

i am trying to learn! thats why I am asking!