Jump to content

Would this use of strtotime work?


ghurty

Recommended Posts

Try it out and see. The best way to see if something works is to try it:

 

$hour = 1;
$minute = 30;
$ampm = "pm";
$time_in_24_hour_format  = DATE("H:i", strtotime("{$hour}:{$minute} {$ampm}"));
echo $time_in_24_hour_format . " 24 hour time";

 

If it displays the 24 hour time, it worked. If not, you can use the mktime function instead of strtotime.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.