Category Covered

PHP convert 24 hour time to 12 hour

Here is an examaple of converting 24 hour time to 12 hour in php. 

function twentyfourToTwelve($time)
{
	return date('g:i:s a', strtotime($time . " UTC"));
}
						    
echo twentyfourToTwelve('15:33:56');

I am sure this will help you to convert 24 hours time to meridian tim.

 

Convert 12 hour time to 24 hour time