time format 24h formate to 12h in php code example Example: convert am pm time to 24 hour in php echo date("H:i:s", strtotime("04:25 PM"));