I have a line like "6:15 pm". Is there any function in PHP that will convert it directly to a 24-hour format. those. until "18:15"?
I would suggest using strtotime()with date():
strtotime()
date()
print date("H:i", strtotime("6:15pm"));
You can do this with strtotime():
echo date('H:i', strtotime('6.:15pm'));
//Call this once before the 1st date/time operation date_default_timezone_set('Europe/Zurich'); echo date('H:i', strtotime('6:15pm'));