日期和时间值不会打印在输入日期时间格式表单框中

好吧,我使用输入类型日期/时间将值存储到 mysql,其中将数据存储为

日期:2020-08-26T18:30:00.000Z 时间:1969-12-31T19:03:00.000Z

现在要在编辑表单上打印,我执行了以下操作,但它只是不显示表单中的值

<label for="callback_date">Callback Date:</label>
    <input type="date" name="callback_date" value="<?php echo date("m/d/Y", strtotime($row['callback_date']));?>"class="form-control" />
    <br />
    <label for="callback_time">Callback Time:</label>
    <input type="time" name="callback_time" value="<?php echo date("h:i A", strtotime($row['callback_time']));?>"  class="form-control" />

有人可以告诉我正确的方法来完成它吗?

多谢


慕仙森
浏览 69回答 1
1回答

元芳怎么了

您没有使用正确的格式在输入中输入日期或时间。您编辑的代码格式正确:<label for="callback_date">Callback Date:</label>     <input type="date" name="callback_date" value="<?php echo date("Y-m-d", strtotime($row['callback_date']));?>"class="form-control" />     <br />     <label for="callback_time">Callback Time:</label>     <input type="time" name="callback_time" value="<?php echo date("H:i", strtotime($row['callback_time']));?>"  class="form-control" />
打开App,查看更多内容
随时随地看视频慕课网APP