$time = strtotime('12:30 PM'); echo "";In this example, we use the `strtotime()` function to convert the string "12:30 PM" to a Unix timestamp. We then use the `date()` function to format the timestamp as an hour:minute string in 24-hour format, and we use that value as the initial value of the time input element. Package library: PHP HTML time is a built-in PHP library that is included with all PHP installations. No additional setup or installation is required.