为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

PHP
慕仙森 2023-10-15 15:37:50
好吧,我使用输入类型日期/时间将值存储到 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" />有人可以告诉我正确的方法来完成它吗?多谢
查看完整描述

1 回答

?
元芳怎么了

TA贡献1798条经验 获得超7个赞

您没有使用正确的格式在输入中输入日期或时间。

您编辑的代码格式正确:

<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" />
查看完整回答
反对 回复 2023-10-15
  • 1 回答
  • 0 关注
  • 66 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信