The server is sending a string in this format: 18:00:00. This is a time-of-day value independent of any date. How to convert it to 6:00PM in Javasc
This might help to format if you are using ES6.
Below code snippet will ignore the seconds. If you want to consider seconds you can add that as the first parameter.
const formatFrom24Hrsto12Hrs = (time, ignoreZero = true) => {
let [hours, minutes] = time.split(':')
let modifier = +hours < 12 ? 'am' : 'pm'
hours = +hours % 12 || 12
minutes = ignoreZero && +minutes === 0 ? '' : `:${minutes}`
return hours + minutes + modifier
}