如何在时间类型输入框中显示数据库值?

how to show db value in time type input box?

想在编辑页面显示之前的数据。

我正在尝试这个

<input type="time" name="opening_hour" value="{{ old('opening_hour', $restaurants->opening_hour) }}" class="form-control">

在数据库中,opening_hour字段是时间类型。值为 10:00:00

但是当我尝试及时显示输入字段时出现错误 array_key_exists(): 第一个参数应该是字符串或整数

在laravelblade我应该做什么?

找到了我的解决方案。它将是 date('H:i', strtotime($restaurants->opening_hour)) 内部值。