changing the time format from HH:MM:SS to HH:MM AM/PM [duplicate]

try

echo $time = date("g:i A", strtotime("10:20:00"));
//output : 10:20 AM

Leave a Comment