In the Survival WordPress Plugin, the score table contains a Time field.
To display a time value in HTML, it’s essential to validate and format the data.
$t = (new DateTime($score->starttime))->format('H:i:s');
echo '<input type="time" name="starttime" id="starttime" value="'.$t.'">';
Alternative
To avoid conversion problems, it is also possible to fetch the value in such a way that it can be used immediately in HTML. In this case, we could have used the format statement in SQL.
Result:
Submit
Next step is to save the time value into WP, yet another time check is needed.
$t = (new DateTime($_POST['starttime']))->format('Y-m-d H:i:s');
Ensure that you enclose the $t value within quotes; otherwise, the time value will not be accepted.