dqu92800 2017-02-28 19:16
浏览 74

我在我的表单中使用输入类型=“日期”,它显示mm / dd / yyyy而不是像10/01/1992这样的日期。

My code is as follows :

    <form > 
    <input type="date" value="<?php $row['DOB']; ?>" name="dob">
    </form>

the datatype of column DOB is date and when i want to view or edit the date is shows only dd-mm-yyyy instead of that date from database

  • 写回答

1条回答 默认 最新

  • dongxiaoshe0737 2017-02-28 19:30
    关注

    You will need to make sure:

    1. that $row['DOB'] actually has the date value (as Qirel already suggested)
    2. that $row['DOB'] value is in the format: 2017-02-27 (NOT: 02/27/2017)

    You can verify that the following code does NOT work (actually, this is browser-specific -- it does NOT work in Chrome, but it works in Firefox and maybe some other web browsers):

    <form > 
      <input type="date" value="02/27/2017" name="dob">
    </form>
    

    But the code below works:

    <form > 
      <input type="date" value="2017-02-27" name="dob">
    </form>
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度