我无法弄清楚将我的时间显示到时间文本框中的秘密格式字符串。时间以这种格式“10:30 AM”存储在数据库中,DeliveryTime 在数据库中定义为字符串。我尝试了与下面类似的各种版本,但均无济于事。请帮忙。
<input type="time" id="DeliveryTime" name="DeliveryTime" class="form-control" value="@Model.DeliveryTime.ToString("hh:mm tt")">
我无法弄清楚将我的时间显示到时间文本框中的秘密格式字符串。时间以这种格式“10:30 AM”存储在数据库中,DeliveryTime 在数据库中定义为字符串。我尝试了与下面类似的各种版本,但均无济于事。请帮忙。
<input type="time" id="DeliveryTime" name="DeliveryTime" class="form-control" value="@Model.DeliveryTime.ToString("hh:mm tt")">