I am parsing the string "11:00 PM" to the database. I want to convert the string to military time as 23:00 and write to the database.
I tried with the below:
$traveltime = "11:00 PM";
$contraveltime = date(strtotime("%H:%i",'$traveltime'));
I get the error
A PHP Error was encountered
Severity: Warning
Message: date() expects parameter 2 to be long, string given
Filename: views/addtrip_individual.php
Line Number: 332
Line 332 is where the second code line is.
How do I make this work?