Convert 12 Hours Time Format To 24Hours Format When Iserting

hi, i have a problem how can i convert time when saving to my database

example my client enter 01:30:00 on my textfield, then when saving to my database will convert to

13:30:00… thank you

You have to add pm, if the hour is less than 12.

$time = '1:30:00';

//$time = '13:30:00';

$hour = date("G",strtotime($time));


    $time=$time.' pm';

echo date("H:i:s", strtotime($time));

thank you sir !!!